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

Rate limit exceeded for sending requests to poe.com. Please try again later. #91

Closed M0HID closed 8 months ago

M0HID commented 11 months ago

Im trying to run this code:

from poe_api_wrapper import PoeApi

def get_word_definition(word):
    client = PoeApi('cEkRoOK7Lic-vGKbMdjS4g==')
    bot = "chinchilla"
    prompt = "Hello"
    message = (
        "Explain the meaning of the word " + word +
        " to a child in less than 30 words. You must give me 4 values: the word, the definition, word type and the example sentence. Your response should be in the following format: word:definition:word type:example sentence. There should be no spaces between the colon and the word. There should be no additional colons in the example sentence. Here is an example output - luminary:someone who is well known:noun:marie curie was a luminary"
    )
    print(message)

    for chunk in client.send_message(bot, message):
        pass

    print(chunk["text"])

    chunk = chunk["text"].split(":")

    return {
        "word": chunk[0].strip(),
        "definition": chunk[1].strip(),
        "word_type": chunk[2].strip(),
        "example_sentence": chunk[3].strip()
    }

Whenever I try to run the code on my server, it gives this error. It works fine if I copy the file locally to my laptop.

Traceback (most recent call last):
  File "/home/ubuntu/fat api/test.py", line 29, in <module>
    result = get_word_definition(word_to_define)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/fat api/test.py", line 4, in get_word_definition
    client = PoeApi('cEkRoOK7Lic-vGKbMdjS4g==')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/miniconda3/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 159, in __init__
    self.connect_ws()
  File "/home/ubuntu/miniconda3/lib/python3.11/site-packages/poe_api_wrapper/api.py", line 282, 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.

Its been happening for over a week now, any ideas why?

I've tried changing the API key, the same key works locally but not on the server.

lpietrobon commented 11 months ago

had the same issue, then realized I had a typo in the token for PoeApi ..maybe try checking that?

KenStevan commented 11 months ago

I also encountered the same problem, I don't know when it will be solved

krishna2206 commented 10 months ago

has anyone found a solution?

Barnacules commented 10 months ago

I also have hit the same problem, is it possible that it only impacts people who signed up through iOS PoE app and not people who signed up via the website? Because when I go into settings it says that I signed up through the iOS App and need to manage my subscription from there. I also tried both coded and decoded formats for the token and it still gives me this error even though I can open the PoE Website, Desktop App and iPhone App all at the same time and they all work as expected 🤔 Any ideas? I'd quite like to be able to use PoE as my Siri replacement on my phone and this would allow me to finally do that using Pythonista or a proxy to my PC if necessary 🙏

Barnacules commented 10 months ago

cEkRoOK7Lic-vGKbMdjS4g==

Just a heads up M0HID you might want to log out of your PoE and log back in to get a new p-b key since the one you published above in the code still seems to work despite my own API key failing with the same error you were getting before 🤣

Barnacules commented 10 months ago

Just a heads up I went into settings on my Quora account and removed the gmail account under "Connected & Linked Accounts" that was next to my Facebook account and magically everything started working right after that. I have no idea what this changed but my guess is that because another GMAIL was connected to Quora despite my gmail email address being the same as PoE higher in the settings menu it was throwing something off. Now it's all working as expected! I hope this helps some of you figure this out.

EugeneBoondock commented 9 months ago

@Barnacules removing the connected Gmail account helped

PMajesty commented 8 months ago

Oh, the dev released a fix. Update the package and read the new readme. It works now 🤦 can't believe I didn't check the releases