Code Monkey home page Code Monkey logo

chatgpt-api-server's People

Contributors

0xraduan avatar axsddlr avatar mrloldev avatar sadmap avatar unresolv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-api-server's Issues

General help

Having troubles. I can get server setup and see my connection when opening gpt through firefox, but I have no idea what to do after that. Complete noob someone dear lord please help I wanna use this chat without the moderation. I use git bash for the $ command and once upon a time it connected but now it says ' No chat available' or something similar. A more in-depth tutorial or reply would be appreciated, I also saw you're releasing a js wrapper so maybe that'll make it easier and I just need to be patient. Idk sorry this is just kind of a rant tbh I've been trying to get this to work for like 5 hours and can't get it

I rent an ECS and have installed and configured software. Is the following procedure correct?

I rent an ECS and have installed and configured software. Is the following procedure correct?

Step 1, first operate: curl "http://*. *. *. *: 8088/client/register" - X GET

Step 2, operate again: curl "http://*. *. *: 8088/api/ask" - X POST -- header 'Authorization: sk111' - d '{"content": "Hello world"}'

Curl "http://*. *. *: 8088/client/register" - X GET, get the error prompt: Bad Request

How to solve it?

Very complex

Very complex to use and to install
Can you please make a video showing step by step with real example

503 service unavailable

I init the api in a docker container and the health check are correct but when I try to make an http request to the api/ask endpoint it gives me the error 503(Service unavailable). My code:

var response = await fetch(`${process.env.API_URL}/ask`, {
    method: "POST",
    headers: {
      "content-type": "application/json",
      Authorization: process.env.API_KEY,
    },
    body: JSON.stringify({
      content: message,
    }),
  });
  console.log(response);
  var json = await response.json();
  console.log(json.content);
  return json.content;

API logs:

2022-12-28 18:20:50 chatgpt-api-server-chatgpt-api-server-1  | [GIN-debug] Listening and serving HTTP on :8080
2022-12-28 18:21:08 chatgpt-api-server-chatgpt-api-server-1  | [GIN] 2022/12/28 - 17:21:08 | 503 |     17.8269ms |      172.28.0.1 | POST     "/api/ask"
2022-12-28 18:21:20 chatgpt-api-server-chatgpt-api-server-1  | [GIN] 2022/12/28 - 17:21:20 | 200 |        28.7µs |       127.0.0.1 | GET      "/health"
2022-12-28 18:21:50 chatgpt-api-server-chatgpt-api-server-1  | [GIN] 2022/12/28 - 17:21:50 | 200 |        24.4µs |       127.0.0.1 | GET      "/health"
2022-12-28 18:22:20 chatgpt-api-server-chatgpt-api-server-1  | [GIN] 2022/12/28 - 17:22:20 | 200 |        21.6µs |       127.0.0.1 | GET      "/health"
2022-12-28 18:22:50 chatgpt-api-server-chatgpt-api-server-1  | [GIN] 2022/12/28 - 17:22:50 | 200 |       215.1µs |       127.0.0.1 | GET      "/health"

Error: Request failed with status code: 429

Getting this error in Firefox on every request

Error: Request failed with status code: 429
fetchData moz-extension://d3c3bcf7-20e0-4b33-ba53-a5daa0abc2de/src/content.js:201
sendChatRequest moz-extension://d3c3bcf7-20e0-4b33-ba53-a5daa0abc2de/src/content.js:124
handleChatGptRequest moz-extension://d3c3bcf7-20e0-4b33-ba53-a5daa0abc2de/src/content.js:102
onmessage moz-extension://d3c3bcf7-20e0-4b33-ba53-a5daa0abc2de/src/content.js:38
onopen moz-extension://d3c3bcf7-20e0-4b33-ba53-a5daa0abc2de/src/content.js:26
EventHandlerNonNull* moz-extension://d3c3bcf7-20e0-4b33-ba53-a5daa0abc2de/src/content.js:24
promise callback* moz-extension://d3c3bcf7-20e0-4b33-ba53-a5daa0abc2de/src/content.js:6

Request takes forever

Hi, Thank you for this project.
I've successfully installed agent and server, I passed the "no available client" prompt and all other API errors
Anyway, when I send the POST request, it just loads forever.
Any ideas, thank!
image

[Err] 404 page not found

Hi there,
Yesterday I ran /api/ask and it was okay, but today it returned 404 page not found after a long period of hanging.
What can I do to fix this error?

image

Sugggestion: Video Tutorial

Hello, I'm reading the instructions, but am confused on how/where to use this. "Go" is already installed and so is "github.com/ChatGPT-Hackers/ChatGPT-API-server@latest", but where do you move on from there? I am not familiar with this process at all and have no idea how to proceed furthermore. A tutorial would be appreciated.

{"error":"No available clients"}

Install the server and agent base on the tutorial:
the server shows:
image

seems it get connected. and I use the :
curl "http://192.168.xxx.xxx:8080/api/ask" -X POST --header 'Authorization: xxxxxxxxxx ' -d '{"content": "Hello world", "conversation_id": "d9e0d2a5-c8f3-4129-8e47-95b2a202d915", "parent_id": "836be1c1-6fe8-4a5a-b37a-0f8ab7cd2ea0"}'

it shows:
{"error":"No available clients"}

What and where should I debug for ?

apikey?

What is the apikey here?

such as : Bearer eyJhxxxxxxx?

Error while installing

I ran go install github.com/ChatGPT-Hackers/ChatGPT-API-server@latest

and this error pops up while installing:

`go: downloading github.com/ChatGPT-Hackers/ChatGPT-API-server v0.0.0-20221224161403-936a75057ee7

golang.org/x/net/http2

../../go/pkg/mod/golang.org/x/[email protected]/http2/frame.go:17:39: error: import error for ‘.golang.org/x/net/http/httpguts.headerValueContainsToken’: lookup of ‘$ret6’ failed
17 | "golang.org/x/net/http/httpguts"
| ^
../../go/pkg/mod/golang.org/x/[email protected]/http2/frame.go:17:39: error: unrecognized binary operator
/home/getxd/go/pkg/mod/golang.org/x/[email protected]/http/httpguts/httplex.go:142: error: not enough arguments to return
/home/getxd/go/pkg/mod/golang.org/x/[email protected]/http/httpguts/httplex.go:144: error: not enough arguments to return
`

[New Feature] Add default retry to every `/api/ask` endpoint to utilize connection pool.

I think we can add default number of retry to each incoming request to /api/ask endpoint. Instead of returning Content-Type: 'application/json' we could return Content-Type: 'text/event-stream'. With this change it might be slightly slower than the original but we would at least try at least 3 times with different agents from connection pool.

For example, proposed change:

/api/ask endpoint content type would be text/event-stream instead of application/json:

curl "http://localhost:8080/api/ask" -X POST --header 'Authorization: <API_KEY>' -d '{"content": "Hello world"}'

default minimum retry # is 3.

In this example /api/ask endpoint failed with first two agent and was successful at the third one.

data: retry #1 failed.

data: retry #2 failed.

data: {"message": { ... }, "conversation_id": " ... "}

data: [DONE]

I believe this would utilize the connection pool even better.

Propose of this server

First of all, sorry for my ignorance.
I haven't clear the propose of this server, I was expecting a server API to can request directly to it the asking sentences in the same way the official webpage does to their backend, but I don't see any reference to chat.openai.com/backend-api endpoints in the code.
Looks like it is built to synchronize with an Agent somehow? Why then it is necessary? I'm missing many things.

Could you explain me more in detal how is it supposed to work? Always with an Agent? what's the role of this server? I would appreciate it so much :)

support text/event-stream for /api/ask

can you add text/event-stream support for /api/ask? So that client can get response as soon as possible, and the response will act as the offical website

Requests hanging

Context: I have the server running as a container in GCP cloud run, and am using the Mozilla agent

Problem: It seems to work for a few requests, but then quickly after I'm not sure exactly what happens but every request hangs and doesn't return anything. When there's no client connected often it will return no client connected, but once it correctly has a connection, everything hangs. In terms of errors, it's usually no error, or a 503. In addition, sometimes there's a correctly registered connection, but when a request comes in to /api/ask, it returns "No client connected".

Win10 and win2012 cannot create a database

I manually created auth.db under the Data folder and still got Failed to create database. Neither the administrator can run cmd nor the powershell administrator can run it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.