diezo / ProGPT

🔥 Free GPT-3.5 Python API
https://buymeacoffee.com/sonii
MIT License
60 stars 8 forks source link

Same Issue is back. #5

Open justin321123 opened 5 months ago

justin321123 commented 5 months ago

` File "/home/container/.local/lib/python3.12/site-packages/discord/ext/commands/core.py", line 235, in wrapped ret = await coro(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/bot.py", line 252, in chatgpt response = conversation.prompt(question) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.12/site-packages/ProGPT/Conversation.py", line 91, in prompt if data["message"]["status"] != "finished_successfully":


KeyError: 'message'`
vlna commented 5 months ago

@diezo I believe I identified the root cause of this issue. I have two accounts. The request from the older one against https://chat.openai.com/backend-api/conversation returns EventStream with AI response. The old account works with your library. The request from the younger account returns json like

{
"wss_url": "wss://chatgpt-async-webps-prod-eastus-18.webpubsub.azure.com/client/hubs/conversations?access_token=SANITIZED",
"expires_at": "2024-02-13T19:38:15.000100+00:00",
"conversation_id": "SANITIZED-aa26dd44a4f3",
"response_id": "SANITIZED330-PRG"

}

And then response is provided via WebSocket base64 encoded.

image

diezo commented 5 months ago

@vlna oh thanks a lot! I think it's easier to fix this issue now. i'll update you on this soon.

justin321123 commented 5 months ago

@diezo Would you be able to share a date on when you think it's done?

diezo commented 5 months ago

@justin321123 I'm currently focused on other projects at the moment. But I'll do my best to get this done by the end of this week.

justin321123 commented 5 months ago

@justin321123 I'm currently focused on other projects at the moment. But I'll do my best to get this done by the end of this week.

Thanks alot.

GaoangLiu commented 5 months ago

@diezo I believe I identified the root cause of this issue. I have two accounts. The request from the older one against https://chat.openai.com/backend-api/conversation returns EventStream with AI response. The old account works with your library. The request from the younger account returns json like

{
"wss_url": "wss://chatgpt-async-webps-prod-eastus-18.webpubsub.azure.com/client/hubs/conversations?access_token=SANITIZED",
"expires_at": "2024-02-13T19:38:15.000100+00:00",
"conversation_id": "SANITIZED-aa26dd44a4f3",
"response_id": "SANITIZED330-PRG"

}

And then response is provided via WebSocket base64 encoded.

image

I've encountered a similar issue, but the situation is not necessarily related to the account itself. In some instances, for the same account, the return is over SSE (Server-Sent Events), while in others, it's over WSS (WebSocket Secure). It's crucial for the code to be adaptable to both scenarios and handle them appropriately.

justin321123 commented 5 months ago

@diezo ?

diezo commented 5 months ago

@justin321123 Working on it. I'll update you once I push the changes.

justin321123 commented 4 months ago

@justin321123 Working on it. I'll update you once I push the changes.

This has been open for a month, any updates. Or is this a given-up project?