ProGPT icon indicating copy to clipboard operation
ProGPT copied to clipboard

Same Issue is back.

Open justin321123 opened this issue 1 year ago • 9 comments

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'

justin321123 avatar Feb 12 '24 21:02 justin321123

@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

vlna avatar Feb 13 '24 19:02 vlna

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

diezo avatar Feb 13 '24 19:02 diezo

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

justin321123 avatar Feb 17 '24 15:02 justin321123

@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.

diezo avatar Feb 18 '24 05:02 diezo

@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.

justin321123 avatar Feb 18 '24 12:02 justin321123

@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.

GaoangLiu avatar Feb 19 '24 04:02 GaoangLiu

@diezo ?

justin321123 avatar Feb 28 '24 14:02 justin321123

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

diezo avatar Mar 01 '24 15:03 diezo

@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?

justin321123 avatar Mar 12 '24 17:03 justin321123