ChatGPT-API-server icon indicating copy to clipboard operation
ChatGPT-API-server copied to clipboard

{"error":"No available clients"}

Open 9cat opened this issue 3 years ago • 37 comments

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 ?

9cat avatar Dec 24 '22 20:12 9cat

same problem here

Yusin2Chen avatar Dec 24 '22 22:12 Yusin2Chen

same issue here

axsddlr avatar Dec 25 '22 02:12 axsddlr

Seems to be a bug with the agent caused by error handlers acting strangely. I have reverted that specific change and it should work now

acheong08 avatar Dec 25 '22 03:12 acheong08

Seems to be a bug with the agent caused by error handlers acting strangely. I have reverted that specific change and it should work now

where is the API Key located?

You set it when you run the executable.

acheong08 avatar Dec 25 '22 03:12 acheong08

Seems to be a bug with the agent caused by error handlers acting strangely. I have reverted that specific change and it should work now

where is the API Key located?

You set it when you run the executable.

i would take it that if you use google to sign in instead of regular sign in then there would be a problem

axsddlr avatar Dec 25 '22 03:12 axsddlr

The API key is set by you and has nothing to do with OpenAI. It's just for authenticating your requests to prevent malicious access to your API endpoint

acheong08 avatar Dec 25 '22 03:12 acheong08

i would take it that if you use google to sign in instead of regular sign in then there would be a problem

If you use google sign in, there won't be autofill but as long as you are able to log in, it's fine

acheong08 avatar Dec 25 '22 03:12 acheong08

You can just fill out dummy credentials for it to open the tabs

acheong08 avatar Dec 25 '22 03:12 acheong08

Fixed at https://github.com/ChatGPT-Hackers/ChatGPT-API-agent/commit/d9aa137d9c946f7a713e966c3f9fef41ba0b6b8a

acheong08 avatar Dec 25 '22 03:12 acheong08

issue still occuring with new changes

commands:

sudo ChatGPT-API-server 8180 546

curl "http://<ip-of-server>:8180/api/ask" -X POST --header 'Authorization: 546' -d '{"content": "Hello world", "conversation_id": "<optional>", "parent_id": "<optional>"}'

result

{"error":"No available clients"}

[GIN] 2022/12/24 - 23:13:47 | 503 | 287.46µs | 192.168.xxx.xxx | POST "/api/ask"

axsddlr avatar Dec 25 '22 04:12 axsddlr

The changes are on the side of the agent. You might want to update that https://github.com/ChatGPT-Hackers/ChatGPT-API-agent

acheong08 avatar Dec 25 '22 04:12 acheong08

The changes are on the side of the agent. You might want to update that https://github.com/ChatGPT-Hackers/ChatGPT-API-agent

yeap, git pulled the changes and re-did setup as is on firefox

axsddlr avatar Dec 25 '22 04:12 axsddlr

Working just fine for me. You have to press reload in the debugging page image

acheong08 avatar Dec 25 '22 04:12 acheong08

after a few tries, got it to work. I can try to containerize this server end

axsddlr avatar Dec 25 '22 04:12 axsddlr

Fixed at ChatGPT-Hackers/ChatGPT-API-agent@d9aa137

Great , it works like a champ

9cat avatar Dec 25 '22 05:12 9cat

I still report an error No available clients, Do I need to manually register the client through GET client/register

zenorochaV1 avatar Dec 25 '22 12:12 zenorochaV1

I still report an error No available clients, Do I need to manually register the client through GET client/register

zenorochaV1 avatar Dec 25 '22 12:12 zenorochaV1

You shouldn't have to

acheong08 avatar Dec 25 '22 12:12 acheong08

You might need to restart firefox. There are bugs with their containers sometimes

acheong08 avatar Dec 25 '22 12:12 acheong08

Make sure your agent can contact your API

acheong08 avatar Dec 25 '22 12:12 acheong08

Make sure your agent can contact your API

Thank you for your reply. I have updated the extension and restarted it for several times, but it still fails. How can I check whether the API can connect to the client

zenorochaV1 avatar Dec 25 '22 12:12 zenorochaV1

Check the server output. It should show a connection id or a GET request to /client/register if it succeeds in connecting

acheong08 avatar Dec 25 '22 12:12 acheong08

You can also debug the JavaScript be checking the console

acheong08 avatar Dec 25 '22 12:12 acheong08

You can also debug the JavaScript be checking the console

Request status code is 400 , Let me check ths.

zenorochaV1 avatar Dec 25 '22 12:12 zenorochaV1

You can also debug the JavaScript be checking the console

It's up and running thank you very much

zenorochaV1 avatar Dec 25 '22 13:12 zenorochaV1

What was the issue and how did you solve it? Leave it here for those that come after

acheong08 avatar Dec 25 '22 13:12 acheong08

How did you solve that, please help me

Yusin2Chen avatar Dec 25 '22 13:12 Yusin2Chen

为什么content.js里是这样的 let ws_route = "ws://" + endpoint + "/client/register"; let ws = new WebSocket(ws_route); router.GET("/client/register", handlers.Client_register)注册的不是HTTP协议的吗,我看浏览器的控制台发现好像ws.onopen没有触发😂

org-org-org avatar Dec 25 '22 14:12 org-org-org

Make sure the endpoint format is correct. <IP_address>:<port_number>

acheong08 avatar Dec 25 '22 15:12 acheong08

And make sure it is accessible

acheong08 avatar Dec 25 '22 15:12 acheong08