Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Same Issue is back. #5

Open
justin321123 opened this issue Feb 12, 2024 · 9 comments
Open

Same Issue is back. #5

justin321123 opened this issue Feb 12, 2024 · 9 comments

Comments

@justin321123
Copy link

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
Copy link

vlna commented Feb 13, 2024

@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
Copy link
Owner

diezo commented Feb 13, 2024

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

@justin321123
Copy link
Author

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

@diezo
Copy link
Owner

diezo commented Feb 18, 2024

@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
Copy link
Author

@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
Copy link

@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
Copy link
Author

@diezo ?

@diezo
Copy link
Owner

diezo commented Mar 1, 2024

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

@justin321123
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants