-
Notifications
You must be signed in to change notification settings - Fork 43.1k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection to api.openai.com timed out #3823
Comments
Check if you have setup billing or if you have enough credit. |
Are you from China? If yes - OpenAI is not supported in China. |
Well it's timing out because it's not receiving an response. Definitely check your billing or if you are even able to just ping the api from your location. Or maybe typos in your api key. Cheers, |
How can we retry without having to go through 5 steps of outlining the goals for the AI again every attempt? There's no obvious cause for this error and it's very difficult to debug when you need to re-enter all this text in 5 separate prompts for every attempt. It seems like an |
Current list of unsupported regions (may be inaccurate, please check with your API provider and your local ordinance) A. Afghanistan |
Thanks for the list @anonhostpi. Unfortunately it doesn't account for my problem since I'm in USA. |
What does a ping of api.openai.com tell you? |
On the host machine the ping works without any issues but I already tried rebooting, reinstalling Docker, Interestingly the site that replies |
That webpage maybe cached, try clearing your cache and reloading that webpage. |
Hey I just noticed something. Your url is wrong. v1/{ai model here__}/chat/completions. It's missing the ai model It says "max retries with v1/chat/completions" |
So this looks like the problematic line: Here's that line in the source code: https://github.com/Significant-Gravitas/Auto-GPT/blob/master/autogpt/llm/api_manager.py#L56. So whatever is providing Traced it back through the files, and this is where https://github.com/Significant-Gravitas/Auto-GPT/blob/master/autogpt/llm/chat.py#LL80C39-L80C39 |
The page isn't cached for me and in our case we don't seem to have any line in the logging like Here's our full log output. In our case the error is Is there some way I can debug the docker machine to ensure it's at least accessing the network? Full log output:Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachableDuring handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
No, but you do have |
https://github.com/Significant-Gravitas/Auto-GPT/blob/master/autogpt/config/config.py#L41 What is your FAST_LLM_MODEL set to? Thank you @guacamole-hunter |
I haven't set the Here's the full (Note: slashes added to avoid Github markdown conversion) `.env`/################################################################################ /### AUTO-GPT - GENERAL SETTINGS /################################################################################/## EXECUTE_LOCAL_COMMANDS - Allow local command execution (Default: False) /## USER_AGENT - Define the user-agent used by the requests library to browse website (string) /## AI_SETTINGS_FILE - Specifies which AI Settings file to use (defaults to ai_settings.yaml) /## AUTHORISE COMMAND KEY - Key to authorise commands /################################################################################ /### OPENAI /### AZURE /################################################################################ /## SMART_LLM_MODEL - Smart language model (Default: gpt-4) /### LLM MODEL SETTINGS /### EMBEDDINGS /################################################################################ /### MEMORY_BACKEND - Memory backend type /### PINECONE /### REDIS /### WEAVIATE /### MILVUS /################################################################################ /### OPEN AI /### HUGGINGFACE /### STABLE DIFFUSION WEBUI /################################################################################ /### HUGGINGFACE /################################################################################ /### GITHUB /################################################################################ /### BROWSER /### GOOGLE /################################################################################ /### MAC OS /### STREAMELEMENTS /### ELEVENLABS /################################################################################ /# TW_CONSUMER_KEY= /################################################################################ /#ALLOWLISTED_PLUGINS - Sets the listed plugins that are allowed (Example: plugin1,plugin2,plugin3) /################################################################################ |
Can you use ```s? Markdown is trying to parse your |
Unfortunately the ``` don't work inside details but I just cleaned it up. Thanks so much for your time and assistance @anonhostpi. |
Interesting... |
Oh I just realized that this is a continuation of #3977. Since the original issue here is not supported, and there's already another thread for you, let's continue on the other one Closing issue as the region of China is not supported.
|
I am in China.How can i use it ? |
vpn probably and set it to europe or us as location |
Which Operating System are you using?
Docker
Which version of Auto-GPT are you using?
Latest Release
GPT-3 or GPT-4?
GPT-4
Steps to reproduce 🕹
Current behavior 😯
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect
self.sock = conn = self._new_conn()
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 179, in _new_conn
raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7f3f8bbde830>, 'Connection to api.openai.com timed out. (connect timeout=600)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 487, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
return self.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
return self.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f3f8bbde830>, 'Connection to api.openai.com timed out. (connect timeout=600)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 516, in request_raw
result = _thread_context.session.request(
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 508, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f3f8bbde830>, 'Connection to api.openai.com timed out. (connect timeout=600)'))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/app/autogpt/main.py", line 5, in
autogpt.cli.main()
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/autogpt/cli.py", line 90, in main
run_auto_gpt(
File "/app/autogpt/main.py", line 171, in run_auto_gpt
agent.start_interaction_loop()
File "/app/autogpt/agent/agent.py", line 112, in start_interaction_loop
assistant_reply = chat_with_ai(
File "/app/autogpt/llm/chat.py", line 245, in chat_with_ai
assistant_reply = create_chat_completion(
File "/app/autogpt/llm/llm_utils.py", line 166, in create_chat_completion
response = api_manager.create_chat_completion(
File "/app/autogpt/llm/api_manager.py", line 55, in create_chat_completion
response = openai.ChatCompletion.create(
File "/usr/local/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 216, in request
result = self.request_raw(
File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 526, in request_raw
raise error.Timeout("Request timed out: {}".format(e)) from e
openai.error.Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f3f8bbde830>, 'Connection to api.openai.com timed out. (connect timeout=600)'))
Expected behavior 🤔
No response
Your prompt 📝
# Paste your prompt here
Your Logs 📒
The text was updated successfully, but these errors were encountered: