AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

RuntimeError: Failed to get response after 5 retries

Open luckyvictor opened this issue 1 year ago • 19 comments

Duplicates

  • [X] 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

luckyvictor avatar Apr 13 '23 20:04 luckyvictor

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

That-Guy-01 avatar Apr 13 '23 21:04 That-Guy-01

+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

GOASIWISH avatar Apr 13 '23 22:04 GOASIWISH

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

ahirane avatar Apr 13 '23 23:04 ahirane

You need a paid account in OpenAI, fixed for me

dandaka avatar Apr 13 '23 23:04 dandaka

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

0xBYTESHIFT avatar Apr 13 '23 23:04 0xBYTESHIFT

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

dandaka avatar Apr 13 '23 23:04 dandaka

I know, I have both of them :(

0xBYTESHIFT avatar Apr 13 '23 23:04 0xBYTESHIFT

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?

Onnture avatar Apr 13 '23 23:04 Onnture

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

That-Guy-01 avatar Apr 13 '23 23:04 That-Guy-01

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 avatar Apr 13 '23 23:04 BlueJ-D

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

BlueJ-D avatar Apr 13 '23 23:04 BlueJ-D

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

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

tycryptty avatar Apr 14 '23 04:04 tycryptty

Made a PR https://github.com/Torantulino/Auto-GPT/pull/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

JuroOravec avatar Apr 14 '23 11:04 JuroOravec

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.

vvkv avatar Apr 15 '23 03:04 vvkv

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

shiuido avatar Apr 15 '23 09:04 shiuido

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?

lokeshaudits avatar Apr 15 '23 12:04 lokeshaudits

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.

p-i- avatar Apr 15 '23 17:04 p-i-

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

Pwuts avatar Apr 19 '23 15:04 Pwuts

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

anonhostpi avatar May 11 '23 16:05 anonhostpi

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[bot] avatar Sep 06 '23 21:09 github-actions[bot]

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

github-actions[bot] avatar Sep 19 '23 01:09 github-actions[bot]