acheong08/EdgeGPT

response error

cetari opened this issue · 9 comments

cetari commented

response["item"]["messages"][-1]["contentOrigin"] == "Apology"

Automated:
👋 Thanks for reporting this issue. @acheong08 will review it shortly. In the meantime, please check to see if there are any similar issues already closed.

This issue is stale because it has been open for 2 days with no activity.

Hello @cetari

this issue occurred when is reached the call limit within 24 hours.

@acheong08 I would propose of adding a more readable message on trigger of this error.

Can you explain the issue and provide a full trace log?

Can you explain the issue and provide a full trace log?

This is mine during the bot.ask() call:

Traceback (most recent call last): File "/Users/gaetano.dorsi/Desktop/amanuensis-simple-ai-agent/env/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script exec(code, module.__dict__) File "/Users/gaetano.dorsi/Desktop/amanuensis-simple-ai-agent/src/main.py", line 33, in <module> asyncio.run(main()) File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/gaetano.dorsi/Desktop/amanuensis-simple-ai-agent/src/main.py", line 26, in main await (asyncio.gather(firstWorker())) File "/Users/gaetano.dorsi/Desktop/amanuensis-simple-ai-agent/src/main.py", line 16, in firstWorker result = await bot.ask(prompt="Hello world", conversation_style=ConversationStyle.creative, wss_link="wss://sydney.bing.com/sydney/ChatHub") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/gaetano.dorsi/Desktop/amanuensis-simple-ai-agent/env/lib/python3.11/site-packages/EdgeGPT.py", line 653, in ask async for final, response in self.chat_hub.ask_stream( File "/Users/gaetano.dorsi/Desktop/amanuensis-simple-ai-agent/env/lib/python3.11/site-packages/EdgeGPT.py", line 566, in ask_stream response["item"]["messages"][-1]["contentOrigin"] == "Apology" ~~~~~~~~~~~~~~~~^^^^^^^^^^^^ KeyError: 'messages'

This issue is stale because it has been open for 2 days with no activity.

#404
adds a detection of Throttled or CAPTCHA

Hello @cetari

this issue occurred when is reached the call limit within 24 hours.

@acheong08 I would propose of adding a more readable message on trigger of this error.

Confirmed. My recent Pull Request #396 actually uses the current error to know when the daily limit (currently 200) has been reached, and cycle through other cookies.json files if they're available to carry on working.