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
687 stars 82 forks source link

Can't get response anymore - API broken? #79

Closed bluusun closed 7 months ago

bluusun commented 7 months ago

from poe_api_wrapper import PoeApi client = PoeApi("") bot = "a2" message = "What is reverse engineering?"

Create new chat thread

Streamed example:

for chunk in client.send_message(bot, message): print(chunk["response"], end="", flush=True) print("\n")

2023-11-21 16:41:36.066 | INFO | poe_api_wrapper.api:send_message:722 - New Thread created | 2qkmmgmidf9uq3lj65q 2023-11-21 16:41:46.072 | WARNING | poe_api_wrapper.api:send_message:792 - Retrying request 1/3 times... 2023-11-21 16:41:56.076 | WARNING | poe_api_wrapper.api:send_message:792 - Retrying request 2/3 times... 2023-11-21 16:42:06.082 | WARNING | poe_api_wrapper.api:send_message:792 - Retrying request 3/3 times... Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 787, in send_message response = self.message_queues[human_message_id].get(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/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 "/test.py", line 9, in for chunk in client.send_message(bot, message): File "/opt/homebrew/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 801, in send_message raise e File "/opt/homebrew/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 797, in send_message raise RuntimeError("Timed out waiting for response.") RuntimeError: Timed out waiting for response.

iDB 2023-11-21 at 4 43 20 PM

I can see the request was sent and response in POE.

snowby666 commented 7 months ago

Can you retry again since its still working for me Tested in env: 3.9, 3.10 and 3.11.

bluusun commented 7 months ago

Tried from different IPs, Linux and Mac. Same error. Used latest pip version and repo version API had been stable since September for me. Anything else I can do to debug?

bluusun commented 7 months ago

Using Python 3.11.6 and 3.8.10. No issue on either version until today. Also tried different tokens.

bluusun commented 7 months ago

Successfully installed poe-api-wrapper-1.3.4

python3 poe-test.py 2023-11-21 22:07:37.257 | INFO | poe_api_wrapper.api:send_message:722 - New Thread created | 2qt3v2dr3or1uge0e0q 2023-11-21 22:07:47.263 | WARNING | poe_api_wrapper.api:send_message:792 - Retrying request 1/3 times... 2023-11-21 22:07:57.269 | WARNING | poe_api_wrapper.api:send_message:792 - Retrying request 2/3 times... 2023-11-21 22:08:07.270 | WARNING | poe_api_wrapper.api:send_message:792 - Retrying request 3/3 times... Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 787, in send_message response = self.message_queues[human_message_id].get(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/queue.py", line 179, in get raise Empty _queue.Empty

bluusun commented 7 months ago

ALso getting this now...

2023-11-22 00:12:10.158 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:10.377 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:10.610 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:10.797 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:11.055 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:11.274 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:11.533 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:11.846 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:12.081 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:12.288 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:12.511 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:12.753 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:13.055 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:13.295 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:13.507 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting... 2023-11-22 00:12:13.692 | WARNING | poe_api_wrapper.api:on_ws_close:314 - Connection to remote host was lost. Reconnecting...

bluusun commented 7 months ago

Changed to capybara. Now I get a response 1/5 times. Rest shows errors.

bluusun commented 7 months ago

PLease try a few times and most times no response is available.

bluusun commented 7 months ago

Reply is always available in poe web interface.

bluusun commented 7 months ago

It seems the timeout setting might get ignored - I now use

for chunk in client.send_message(bot, prompt,file_path=file_urls,timeout=400):

bluusun commented 7 months ago

It seems to look for some immediate response from poe - if it does not get one it sends retry requests and all fail. Most of my replies take about 30-60 seconds on the web. That timeout seems to get ignored. Any ideas?

snowby666 commented 7 months ago

It seems that Poe may have changed their system again. I'll look into it.

bluusun commented 7 months ago

I think it works again. Maybe it was some poe issue? Most requests error out via API but worked in web interface. Now it's mostly back...Thanks for this amazing API btw!