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
905 stars 104 forks source link

Rate limit exceeded for sending requests to poe.com. #184

Closed Student2Pro closed 1 month ago

Student2Pro commented 3 months ago

I followed the steps in readme and got the following error:

2024-08-01 20:27:58.617 | INFO     | poe_api_wrapper.bundles:init_window:21 - Initializing web data
2024-08-01 20:27:58.619 | INFO     | poe_api_wrapper.bundles:init_window:41 - Web data initialized
2024-08-01 20:27:58.619 | ERROR    | poe_api_wrapper.api:load_bundle:91 - Failed to load bundle. Reason: 'NoneType' object has no attribute 'group'
2024-08-01 20:27:58.619 | WARNING  | poe_api_wrapper.api:load_bundle:92 - Continuing with provided formkey
2024-08-01 20:27:58.633 | ERROR    | poe_api_wrapper.api:connect_ws:228 - Failed to get channel settings. Reason: unexpected character: line 1 column 1 (char 0)
2024-08-01 20:27:59.644 | ERROR    | poe_api_wrapper.api:connect_ws:228 - Failed to get channel settings. Reason: unexpected character: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/envs/poe/bin/poe", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/ubuntu/anaconda3/envs/poe/lib/python3.11/site-packages/poe_api_wrapper/cli.py", line 13, in main
    PoeExample(tokens).chat_with_bot()
    ^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/anaconda3/envs/poe/lib/python3.11/site-packages/poe_api_wrapper/example.py", line 22, in __init__
    self.client = PoeApi(tokens=self.tokens)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/anaconda3/envs/poe/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 74, in __init__
    self.connect_ws() 
    ^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/anaconda3/envs/poe/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 223, in connect_ws
    raise RuntimeError("Rate limit exceeded for sending requests to poe.com. Please try again later.")
RuntimeError: Rate limit exceeded for sending requests to poe.com. Please try again later.

I try to access LLMs on poe for automatic inference, I mean, I want to test those LLMs' accuracy on certain datasets. Any suggestion is welcome.

[update Aug.7] This is what I do: I install anaconda3 on an ubuntu server (x64), and create an env (python=3.10) for this. Then, I install this package pip install -U poe-api-wrapper. Next, I copy the tokens and run poe -b kDfxxxxxxxxx6hk0Ow== -lat 40xxxxxxxxxxxxxxxxxxxxxxx0i5XpJmdvwTQ== -f f03e6cf6xxxxxxxxxxxxxxxxxxx387b80a666 (tokens are masked). This is the output:

Skipping ProxyFetcher due to No module named 'ballyregan'.
2024-08-07 22:04:16.566 | INFO     | poe_api_wrapper.bundles:init_window:21 - Initializing web data
2024-08-07 22:04:16.568 | INFO     | poe_api_wrapper.bundles:init_window:41 - Web data initialized
2024-08-07 22:04:16.568 | ERROR    | poe_api_wrapper.api:load_bundle:91 - Failed to load bundle. Reason: 'NoneType' object has no attribute 'group'
2024-08-07 22:04:16.569 | WARNING  | poe_api_wrapper.api:load_bundle:92 - Continuing with provided formkey
2024-08-07 22:04:16.584 | ERROR    | poe_api_wrapper.api:connect_ws:228 - Failed to get channel settings. Reason: unexpected character: line 1 column 1 (char 0)
2024-08-07 22:04:17.599 | ERROR    | poe_api_wrapper.api:connect_ws:228 - Failed to get channel settings. Reason: unexpected character: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/remote/anaconda3/envs/poe2/bin/poe", line 8, in <module>
    sys.exit(main())
  File "/home/remote/anaconda3/envs/poe2/lib/python3.10/site-packages/poe_api_wrapper/cli.py", line 13, in main
    PoeExample(tokens).chat_with_bot()
  File "/home/remote/anaconda3/envs/poe2/lib/python3.10/site-packages/poe_api_wrapper/example.py", line 22, in __init__
    self.client = PoeApi(tokens=self.tokens)
  File "/home/remote/anaconda3/envs/poe2/lib/python3.10/site-packages/poe_api_wrapper/api.py", line 74, in __init__
    self.connect_ws()
  File "/home/remote/anaconda3/envs/poe2/lib/python3.10/site-packages/poe_api_wrapper/api.py", line 223, in connect_ws
    raise RuntimeError("Rate limit exceeded for sending requests to poe.com. Please try again later.")
RuntimeError: Rate limit exceeded for sending requests to poe.com. Please try again later.
JiugeLi commented 2 months ago

You need to log in to your PoE account on your computer browser, open the webpage, and then set up the corresponding token.

Student2Pro commented 2 months ago

You need to log in to your PoE account on your computer browser, open the webpage, and then set up the corresponding token.

If you mean the p-b and p-lat cookies, I have copied them from browser, as described in the readme (format-key too). If I misunderstand it, please correct me. BTW, I wonder if the error is due to the location since my server is in HongKong.

MaxMerwijk commented 2 months ago

I have the same errors

LarryUESTC commented 2 months ago

I sovled it, you just need to set 'formkey':xxxx as well as 'p-lab'