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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Failed to get response after 5 retries #1189

Closed
1 task done
luckyvictor opened this issue Apr 13, 2023 · 21 comments
Closed
1 task done

RuntimeError: Failed to get response after 5 retries #1189

luckyvictor opened this issue Apr 13, 2023 · 21 comments
Labels
API access Trouble with connecting to the API Stale

Comments

@luckyvictor
Copy link

Duplicates

  • I have searched the existing issues

Steps to reproduce 馃暪

I am on Mac.

No problem with the installation process, very smooth. I followed the instructions and input my openai api key as well as pinecone api key and region code.

I managed to start the agent and gone as far as entering the 5 goals.

It gave me a warning of no auto-gpt.json, believe it is not a big deal.

However after a minute of waiting, it reports

RuntimeError: Failed to get response after 5 retries

what is it and why do I get it?

Current behavior 馃槸

No response

Expected behavior 馃

No response

Your prompt 馃摑

# Paste your prompt here
@That-Guy-01
Copy link

run python scripts/main.py --debug and check the results

@GOASIWISH
Copy link

+1 I followed the same instructions from this YouTube (https://www.youtube.com/watch?v=7On7vRBGz78 ) but kept seeing this error- RuntimeError: Failed to get response after 5 retries

@ahirane
Copy link

ahirane commented Apr 13, 2023

run python scripts/main.py --debug and check the results

----------- END OF CONTEXT ----------------
Error: API Rate Limit Reached. Waiting 20 seconds...
Error: API Rate Limit Reached. Waiting 20 seconds...
Error: API Rate Limit Reached. Waiting 20 seconds...
Error: API Rate Limit Reached. Waiting 20 seconds...
Error: API Rate Limit Reached. Waiting 20 seconds...
Traceback (most recent call last):
File "scripts/main.py", line 461, in
main()
File "scripts/main.py", line 365, in main
assistant_reply = chat.chat_with_ai(
File "C:\Users\mappe\Desktop\Auto-GPT\scripts\chat.py", line 126, in chat_with_ai
assistant_reply = create_chat_completion(
File "C:\Users\mappe\Desktop\Auto-GPT\scripts\llm_utils.py", line 50, in create_chat_completion
raise RuntimeError("Failed to get response after 5 retries")
RuntimeError: Failed to get response after 5 retries

@dandaka
Copy link

dandaka commented Apr 13, 2023

You need a paid account in OpenAI, fixed for me

@0xBYTESHIFT
Copy link

0xBYTESHIFT commented Apr 13, 2023

I have a paid account. And I still get the same errors as people above

Error:  API Rate Limit Reached. Waiting 20 seconds...
Error:  API Rate Limit Reached. Waiting 20 seconds...
Error:  API Rate Limit Reached. Waiting 20 seconds...
Error:  API Rate Limit Reached. Waiting 20 seconds...
Error:  API Rate Limit Reached. Waiting 20 seconds...
Traceback (most recent call last):
  File "/home/tort/prog/Auto-GPT/scripts/main.py", line 461, in <module>
    main()
  File "/home/tort/prog/Auto-GPT/scripts/main.py", line 365, in main
    assistant_reply = chat.chat_with_ai(
                      ^^^^^^^^^^^^^^^^^^
  File "/home/tort/prog/Auto-GPT/scripts/chat.py", line 126, in chat_with_ai
    assistant_reply = create_chat_completion(
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tort/prog/Auto-GPT/scripts/llm_utils.py", line 50, in create_chat_completion
    raise RuntimeError("Failed to get response after 5 retries")
RuntimeError: Failed to get response after 5 retries

@dandaka
Copy link

dandaka commented Apr 13, 2023

There is a paid ChatGPT account and there is a paid OpenAI API account. You need to have the second one.

@0xBYTESHIFT
Copy link

I know, I have both of them :(

@Onnture
Copy link

Onnture commented Apr 13, 2023

says its $5 a month depending on usage, I understand that Auto-GPT requires a lot of that usage, is it expensive to use then?

@That-Guy-01
Copy link

If you have a paid open-ai account (not ChatGPT pro) then you鈥檒l need to check things like your monthly token limit or your payment method on open-ai鈥檚 site. Confirm you have available tokens.

@BlueJ-D
Copy link

BlueJ-D commented Apr 13, 2023

I know, I have both of them :(

Have you checked that the account has a credit / debit card added and that you havent got any limits set in your open ai playground account. You may have set a limit?

Also if you use a google account to login, i've seen comments saying this could cause a limit issue.

@BlueJ-D
Copy link

BlueJ-D commented Apr 13, 2023

says its $5 a month depending on usage, I understand that Auto-GPT requires a lot of that usage, is it expensive to use then?

if you use gpt4 it can get very costly yes

@tycryptty
Copy link

tycryptty commented Apr 14, 2023

Same issue, I have a paid OpenAI API acc but still got the issue.

Update: I start a new terminal and it works now.

This was referenced Apr 14, 2023
@JuroOravec
Copy link
Contributor

Made a PR #1304 to make it clear in the README that one has to opt in to the OpenAI's paid account (and add billing info) for the OpenAI's API key to work, which seems to be a common cause for the API Rate Limit Reached. Waiting 20 seconds error

@vvkv
Copy link

vvkv commented Apr 15, 2023

Thank you for making the PR - however, I've had the OpenAI paid account (with $120 usage limit) and still continue to get the same error. I have also tried to generate a new API key twice now - same issue.
.env file has been updated with the openapi key in double quotes as mentioned in the readme.

@shiuido
Copy link

shiuido commented Apr 15, 2023

Why has this happened? Yesterday I ran auto-gpt just fine without a paid account.

@lokeshaudits
Copy link

Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Windows\System32\Auto-GPT\autogpt_main
.py", line 572, in
main()
File "C:\Windows\System32\Auto-GPT\autogpt_main
.py", line 396, in main
agent.start_interaction_loop()
File "C:\Windows\System32\Auto-GPT\autogpt_main_.py", line 448, in start_interaction_loop
assistant_reply = chat.chat_with_ai(
^^^^^^^^^^^^^^^^^^
File "C:\Windows\System32\Auto-GPT\autogpt\chat.py", line 159, in chat_with_ai
assistant_reply = create_chat_completion(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Windows\System32\Auto-GPT\autogpt\llm_utils.py", line 67, in create_chat_completion
raise RuntimeError("Failed to get response after 5 retries")
RuntimeError: Failed to get response after 5 retries

The above is the Runtime error I receive. What is the solution?

@p-i-
Copy link
Contributor

p-i- commented Apr 15, 2023

There's an issue of one OpenAI API key in the shell environment and a second one in the .env file, and the code is using the first one.

We should print the first few characters of the license key to console to avoid this.

@Pwuts Pwuts changed the title what is it and why do I get this error? RuntimeError: Failed to get response after 5 retries RuntimeError: Failed to get response after 5 retries Apr 19, 2023
@Pwuts Pwuts added the API access Trouble with connecting to the API label Apr 19, 2023
@Pwuts
Copy link
Member

Pwuts commented Apr 19, 2023

This can use some love:

  • Print the first few characters of the API key in the log for debug purposes
  • Detect (if possible) lack of API access and throw a descriptive error for that

@anonhostpi
Copy link

I've added all of the linked issues to my rate-limit issue tracker to make them easier to track: Gist | Alt

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

@github-actions github-actions bot added the Stale label Sep 6, 2023
@github-actions
Copy link

This issue was closed automatically because it has been stale for 10 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API access Trouble with connecting to the API Stale
Projects
None yet
Development

No branches or pull requests