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
959 stars 114 forks source link

Timeouts with Claude 3 and Files #115

Open victoryhb opened 9 months ago

victoryhb commented 9 months ago

When processing moderately sized files (1-2 MB PDF journal articles, ~6000-20000 tokens) with the Claude 3 model on Poe, I encounter the following behavior:

Problem with the Poe platform itself (as shown on Poe.com during the running of the script): Claude 3 becomes unresponsive for a period (with the message "Unable to reach Poe"), and after one minute or so, Poe suddenly shows the complete output. API Wrapper (version: 1.3.8) timeouts: During the unresponsiveness, the poe-api-wrapper retries the request three times before raising a timeout error (at which time the complete output is already returned on Poe.com). Increasing the timeout setting does not resolve the issue.

Any idea how to fix this? Thanks!

beetlesa commented 4 months ago

I'm encountering the same issue. Poe has already returned all the content, and I've received everything using the stream method. However, the project shows:

2024-07-20 11:17:53.918 | WARNING | poe_api_wrapper.api:send_message:843 - Retrying request 1/3 times... 2024-07-20 11:18:13.924 | WARNING | poe_api_wrapper.api:send_message:843 - Retrying request 2/3 times... 2024-07-20 11:18:33.926 | WARNING | poe_api_wrapper.api:send_message:843 - Retrying request 3/3 times... 2024-07-20 11:18:43.657 | WARNING | poe_api_wrapper.api:on_ws_close:272 - Connection to remote host was lost. Reconnecting...

When I changed the values of p-b and p-lat, the program started working correctly. Even after reverting to the original values of p-b and p-lat, the issue persisted.

I'm using a bot built which designed to format documents , bot is based on Gemini-1.5-flash, I eventually bypassed the issue where the program couldn't read Steam content and kept retrying ("Retrying request 1/3 times") by creating a new bot to continue the work.

bot name is: format_split_txt The issue is reproducible. Hopefully, this information will be helpful in resolving the bug.

update: I found that using bots in the Poe client is normal, but when using the program API, it keeps retrying and cannot get the bot's return message. I tried calling client.chat_break(bot, chatCode=chatCode) and then the bot worked normally again. So I'm syncing this information here.

zhsfei commented 3 months ago

Thank you very much for your note, it solved my problem