Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
166.09k stars 43.97k forks source link

RuntimeError: Failed to get response after 5 retries #1189

Closed luckyvictor closed 11 months ago

luckyvictor commented 1 year ago

Duplicates

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 commented 1 year ago

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

GOASIWISH commented 1 year ago

+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 commented 1 year ago

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 commented 1 year ago

You need a paid account in OpenAI, fixed for me

0xBYTESHIFT commented 1 year ago

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 commented 1 year ago

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

0xBYTESHIFT commented 1 year ago

I know, I have both of them :(

Onnture commented 1 year ago

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 commented 1 year ago

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.

BlueJ-D commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

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

JuroOravec commented 1 year ago

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

vvkv commented 1 year ago

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 commented 1 year ago

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

lokeshaudits commented 1 year ago

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- commented 1 year ago

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 commented 1 year ago

This can use some love:

anonhostpi commented 1 year ago

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

github-actions[bot] commented 11 months ago

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] commented 11 months ago

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