Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Rate limit exceeded #15

Closed
kengetz opened this issue Mar 9, 2023 · 10 comments
Closed

Rate limit exceeded #15

kengetz opened this issue Mar 9, 2023 · 10 comments
Labels
help wanted Extra attention is needed

Comments

@kengetz
Copy link

kengetz commented Mar 9, 2023

Thanks for the great add-in, but I'm getting an error about my rate limit being exceeded, even though I haven't used ChatGPT at all. My OpenAI dashboard shows no requests for march. Not sure what's up...

@chrislemke chrislemke added the help wanted Extra attention is needed label Mar 9, 2023
@chrislemke
Copy link
Owner

Hey @kengetz!

Could you give some more details? E.g. the exact error message. Thanks in advance.

@kengetz
Copy link
Author

kengetz commented Mar 9, 2023 via email

@chrislemke
Copy link
Owner

Here are some useful links concerning the rate limit:
https://help.openai.com/en/articles/6897202-ratelimiterror
https://help.openai.com/en/articles/6891753-rate-limit-advice

It could be, that the max tokens are set too high. The default for ChatGPT is 4096. You can try adjusting them in the workflow's configuration (Maximum tokens).

You could also try the solution I talked about in this post. With this, you will get a more detailed error message.

@dna75
Copy link

dna75 commented Mar 9, 2023

Same issue here! My token is set but get the same 'rate limit' warning. I checked my openai credits and have used barely anything.

@chrislemke
Copy link
Owner

chrislemke commented Mar 10, 2023

Hey!
I just created a new release (1.2.1). It contains some new features for troubleshooting maybe this can help you guys solve your issue.

@kengetz
Copy link
Author

kengetz commented Mar 10, 2023 via email

@dna75
Copy link

dna75 commented Mar 12, 2023

I installed 1.2.1
I get an error;
[10:10:29.033] ERROR: ChatFred[Run Script] Traceback (most recent call last):
File "/Users/mymac/stack/Alfred.alfredpreferences/workflows/user.workflow.ECF95AA9-E47F-4F55-854B-09B54347B2ED/src/text_chat.py", line 186, in
__prompt, __response = ke_chat_request(
^^^^^^^^^^^^^^^^^^
File "/Users/mymac/stack/Alfred.alfredpreferences/workflows/user.workflow.ECF95AA9-E47F-4F55-854B-09B54347B2ED/src/text_chat.py", line 147, in make_chat_request
intercept_custom_prompts(prompt)
File "/Users/mymac/stack/Alfred.alfredpreferences/workflows/user.workflow.ECF95AA9-E47F-4F55-854B-09B54347B2ED/src/text_chat.py", line 98, in intercept_custom_prompts
last_request_successful = read_from_cache("last_chat_request_successful")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mymac/stack/Alfred.alfredpreferences/workflows/user.workflow.ECF95AA9-E47F-4F55-854B-09B54347B2ED/src/global_services.py", line 38, in read_from_cache
data = plistlib.load(plist)
^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/plistlib.py", line 869, in load
raise InvalidFileException()
plistlib.InvalidFileException: Invalid file

@chrislemke
Copy link
Owner

chrislemke commented Mar 12, 2023

Could you check if you have the ~/Library/Application Support/Alfred/Workflow Data/ai.lemke.chatfred/ChatFred_Cache file?

It somehow looks you still have the old code:

09B54347B2ED/src/global_services.py", line 38, in read_from_cache
data = plistlib.load(plist)

Maybe you can check if /Users/mymac/stack/Alfred.alfredpreferences/workflows/user.workflow.ECF95AA9-E47F-4F55-854B-09B54347B2ED/src/global_services.py" contains this function?

def read_from_cache(entry: str) -> Union[str, int, float, bool, None]:
    """Reads the cache file and returns the value of the entry."""

    if os.path.exists(__cache_file_path):
        with open(__cache_file_path, "rb") as plist:
            data = plistlib.load(plist)
        return data.get(entry)
    else:
        return False

@dna75
Copy link

dna75 commented Mar 15, 2023

I added my Billing information + payment method and now it's working!

@chrislemke
Copy link
Owner

Great! Thanks for your update. Enjoy using ChatFred!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants