Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate Limit exceeded RuntimeError #162

Closed
SolarDriftCom opened this issue Jun 13, 2024 · 16 comments
Closed

Rate Limit exceeded RuntimeError #162

SolarDriftCom opened this issue Jun 13, 2024 · 16 comments

Comments

@SolarDriftCom
Copy link

SolarDriftCom commented Jun 13, 2024

Hi,

I get this error no matter what I do once setup the client:

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.

Any ideas? I am subscribed in Poe so any model should work? I tried GPT-4o, GPT-4o-128k, and GPT-3_5

Code:

from poe_api_wrapper import PoeApi

tokens = { # Copy the values of m-b and m-lat cookies AFTER LOGGING IN TO POE.COM
'b': '...',
'lat': '...',
'__cf_bm': '...',
'cf_clearance': '...'
}
client = PoeApi(cookie=tokens)
bot = "GPT-4o-128k"

file_urls = ["https://mypdffile.pdf"] # SWAP OUT FOR REAL FILE
for chunk in client.send_message(bot, "Taking the attached document answer all of the following questions in JSON format:\nWhat is the customers full name and title in the attached document?\n", file_path=file_urls):
print(chunk["response"], end="", flush=True)

I also cleared all cookies and logged in again to Poe.com to get new cookie values, but still same error.

Note it first shows a lot of purple output before the above error with HTML in it, and the Javascript error identified in issue #130

Thanks
Paul

@yuvenbn
Copy link

yuvenbn commented Jun 17, 2024

I also got the Rate Limit Error on my first attempt when using the 'b' and 'lat' tokens I got from Poe.com.
But when I used the tokens from Quora.com itself, it started working.

@snowby666
Copy link
Owner

This is fixed in the v1.4.3. Please check documentation for new config.

@SolarDriftCom
Copy link
Author

SolarDriftCom commented Jun 17, 2024

@snowby666 I installed the latest version 2 days ago using pip, and the error still exists? Can you let me know what I am doing wrong? Thanks

UPDATE: Apologies, I see you just recently updated the library, thanks

@snowby666
Copy link
Owner

@snowby666 I installed the latest version 2 days ago using pip, and the error still exists? Can you let me know what I am doing wrong? Thanks

UPDATE: Apologies, I see you just recently updated the library, thanks

Keep me update if there is any error ^^

@SolarDriftCom
Copy link
Author

SolarDriftCom commented Jun 17, 2024

OK

I have the value of this from Chrome:

2nd Method: Devtools > Console > Type: allow pasting > Paste this script: window.ereNdsRqhp2Rd3LEW()

Copy the result

I also have all these:

tokens = {
'p-b': 'p-b cookie here',
'p-lat': 'p-lat cookie here',
'formkey': 'formkey here',
'__cf_bm': '__cf_bm cookie here',
'cf_clearance': 'cf_clearance cookie here'
}

(Obviously with the correct values)

From poe.com

But get this:

Traceback (most recent call last):
File "/var/www/readfile.ai/public_html/api/routes/test-poe-api/poeTest2.py", line 11, in
client = PoeApi(tokens=tokens)
File "/home/secureuser/miniconda3/lib/python3.10/site-packages/poe_api_wrapper/api.py", line 34, in init
raise ValueError("Please provide valid p-b, p-lat and formkey")
ValueError: Please provide valid p-b, p-lat and formkey

@snowby666
Copy link
Owner

OK

I have the value of this from Chrome:

2nd Method: Devtools > Console > Type: allow pasting > Paste this script: window.ereNdsRqhp2Rd3LEW()

Copy the result

I also have all these:

tokens = { 'p-b': 'p-b cookie here', 'p-lat': 'p-lat cookie here', 'formkey': 'formkey here', '__cf_bm': '__cf_bm cookie here', 'cf_clearance': 'cf_clearance cookie here' }

(Obviously with the correct values)

From poe.com

But get this:

Traceback (most recent call last): File "/var/www/readfile.ai/public_html/api/routes/test-poe-api/poeTest2.py", line 11, in client = PoeApi(tokens=tokens) File "/home/secureuser/miniconda3/lib/python3.10/site-packages/poe_api_wrapper/api.py", line 34, in init raise ValueError("Please provide valid p-b, p-lat and formkey") ValueError: Please provide valid p-b, p-lat and formkey

please check your tokens again if you are missing "," or anything

@SolarDriftCom
Copy link
Author

SolarDriftCom commented Jun 18, 2024

Not missing anything? See:

tokens = { # Copy the values of m-b and m-lat cookies AFTER LOGGING IN TO POE.COM
'b': 'Wkl5BTsMQTuwXiHR54e2Kg%3D****',
'lat': 'tJlVQGYrHtLN0v53VDD7ud6x****',
'formKey': 'bbd527e2e00cb1381b3ab613****',
'__cf_bm': '5btmwPIYfuPHeSh0.WQwVwyahvWt1G.UMlqBL5FKjI-1718644023-1.0.1.1-WkytrqBKkRNN7z2DXh33xNSnz0QBeZNpI1h4Xxff.iJREg3sRzkIIX****',
'cf_clearance': '0JmfJ9a1PpRBPTy.bmXeKDIYE4v1GZRDjzDcBLPYGnw-1718644024-1.0.1.1-FwPORPEd1
.LpcypYAb0IDturJM5wmPdX4lBKySC8eStsl2vKc75n***'
}

client = PoeApi(tokens=tokens)
bot = "GPT-4o-128k"

file_urls = ["https://readfileaiprocessed.pdf"]
for chunk in client.send_message(bot, "Taking the attached document answer all of the following questions in JSON format:\nWhat is the customers full name and title in the attached document?\n", file_path=file_urls):
print(chunk["response"], end="", flush=True)

Same error? I am desperate to get this working. Currently I am manually processing 1000 documents a day :-)

@snowby666
Copy link
Owner

snowby666 commented Jun 18, 2024

I've just changed the config for client. They should be "p-b" and "p-lat" not "b" and "lat". Theres a typo for formkey with "K" instead of "k" btw ^^

@SolarDriftCom
Copy link
Author

Ok thanks, that seems to have got me a bit further. But I now get this:

File "/home/secureuser/miniconda3/lib/python3.10/site-packages/poe_api_wrapper/api.py", line 654, in send_message
message_data = self.send_request(apiPath, 'SendMessageMutation', variables, file_form)
File "/home/secureuser/miniconda3/lib/python3.10/site-packages/poe_api_wrapper/api.py", line 117, in send_request
"poe-tag-id": hashlib.md5((payload + self.formkey + "4LxgHM6KpFqokX0Ox").encode()).hexdigest(),
TypeError: can't concat str to bytes

Thanks
Paul

@snowby666
Copy link
Owner

Theres a patch for uploading file now in v1.4.5

@SolarDriftCom
Copy link
Author

SolarDriftCom commented Jun 18, 2024

Ok, any documentation for the patch? I can only see tags up to v1.4.3? Thanks

@snowby666
Copy link
Owner

just update the lib and it should work now

@SolarDriftCom
Copy link
Author

OK :-)

@SolarDriftCom
Copy link
Author

SolarDriftCom commented Jun 18, 2024

Honestly your a genius and a legend! Thank you so much :-) Now my wrists and hands can remain intact from processing manually so much.

@snowby666
Copy link
Owner

Glad it helps :D

@snowby666
Copy link
Owner

I'm closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants