snowby666 / poe-api-wrapper

👾 A Python API wrapper for Poe.com. With this, you will have free access to GPT-4, Claude, Llama, Gemini, Mistral and more! 🚀
https://pypi.org/project/poe-api-wrapper/
GNU General Public License v3.0
957 stars 113 forks source link

Timeour error #185

Open DuyguA opened 3 months ago

DuyguA commented 3 months ago

I get this error with Gemini Pro 1.0:

Skipping ProxyFetcher due to No module named 'ballyregan'.
2024-08-18 09:52:35.404 | INFO     | poe_api_wrapper.bundles:init_window:21 - Initializing web data
2024-08-18 09:52:35.563 | INFO     | poe_api_wrapper.bundles:init_window:41 - Web data initialized
2024-08-18 09:52:35.565 | INFO     | poe_api_wrapper.bundles:get_form_key:82 - Retrieved formkey successfully: acfd5d866445071aed1db4efa70bde12
2024-08-18 09:52:42.942 | WARNING  | poe_api_wrapper.api:send_message:846 - Retrying request 1/3 times...
2024-08-18 09:52:47.942 | WARNING  | poe_api_wrapper.api:send_message:846 - Retrying request 2/3 times...
2024-08-18 09:52:52.943 | WARNING  | poe_api_wrapper.api:send_message:846 - Retrying request 3/3 times...
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/poe_api_wrapper/api.py", line 838, in send_message
    ws_data = self.message_queues[chatId].get(timeout=timeout)
  File "/usr/lib/python3.9/queue.py", line 179, in get
    raise Empty
_queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/disks/newd/Benchmarking/senti-turca/e-commerce/again/free_gemini2.py", line 56, in <module>
    for chunk in client.send_message(bot, message, chatCode="3iehr0gtnny88270n81"):
  File "/usr/local/lib/python3.9/dist-packages/poe_api_wrapper/api.py", line 854, in send_message
    raise e
  File "/usr/local/lib/python3.9/dist-packages/poe_api_wrapper/api.py", line 850, in send_message
    raise RuntimeError("Timed out waiting for response.")
RuntimeError: Timed out waiting for response.

I tried cleaning the context, creating a new bot but nothing helped. Any help is appreciated!

mohlach23 commented 2 months ago

Same thing...

JonSuper commented 2 months ago

the temporary fix works for me : on /poe_api_wrapper/api.py change the timeout to 10 seconds and then add except Exception as e: if (len(last_text) > 0): yield response return raise e yield the response if last_text not empty while queue.Empty