AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Mac open API key error communicating with openai

Open ethanye77 opened this issue 2 years ago • 8 comments

Duplicates

  • [X] I have searched the existing issues

Steps to reproduce 🕹

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/ethanye/auto-GPT/scripts/main.py", line 461, in main() File "/Users/ethanye/auto-GPT/scripts/main.py", line 365, in main assistant_reply = chat.chat_with_ai( File "/Users/ethanye/auto-GPT/scripts/chat.py", line 126, in chat_with_ai assistant_reply = create_chat_completion( File "/Users/ethanye/auto-GPT/scripts/llm_utils.py", line 28, in create_chat_completion response = openai.ChatCompletion.create( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create return super().create(*args, **kwargs) File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_requestor.py", line 216, in request result = self.request_raw( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_requestor.py", line 529, in request_raw raise error.APIConnectionError( openai.error.APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) bash-3.2$

after trying tons of ways, I could not solve this, somebody help!!!!! maybe when I am older it will all calm down but it is killing me now!

Current behavior 😯

can't link to open ai API

Expected behavior 🤔

sua~~~ and it link the API super quickly

Your prompt 📝

# Paste your prompt here

Last login: Fri Apr 14 17:07:53 on ttys002 (base) ethanye@Ethans-MacBook-Pro ~ % bash

The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh. For more details, please visit https://support.apple.com/kb/HT208050. bash-3.2$ pip list | grep openai openai 0.27.4 bash-3.2$ cd auto-GPT/ bash-3.2$ python scripts/main.py Welcome back! Would you like me to return to being vri? Continue with the last settings? Name: vri Role: web searcher Goals: ['search the differences between GPT-4 barn newbing claude and Auto-GPT', 'make a comparison of them and make a form ', 'send the result to gmail:[email protected]', 'create a picture of AI astronaut rinding horse behind the form', 'send the form and picture to gmail:[email protected] when finished'] Continue (y/n): y Using memory of type: LocalCache Traceback (most recent call last): File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/Users/ethanye/anaconda3/lib/python3.10/http/client.py", line 1374, in getresponse response.begin() File "/Users/ethanye/anaconda3/lib/python3.10/http/client.py", line 318, in begin version, status, reason = self._read_status() File "/Users/ethanye/anaconda3/lib/python3.10/http/client.py", line 287, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen retries = retries.increment( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/Users/ethanye/anaconda3/lib/python3.10/http/client.py", line 1374, in getresponse response.begin() File "/Users/ethanye/anaconda3/lib/python3.10/http/client.py", line 318, in begin version, status, reason = self._read_status() File "/Users/ethanye/anaconda3/lib/python3.10/http/client.py", line 287, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_requestor.py", line 516, in request_raw result = _thread_context.session.request( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/requests/adapters.py", line 547, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/ethanye/auto-GPT/scripts/main.py", line 461, in main() File "/Users/ethanye/auto-GPT/scripts/main.py", line 365, in main assistant_reply = chat.chat_with_ai( File "/Users/ethanye/auto-GPT/scripts/chat.py", line 126, in chat_with_ai assistant_reply = create_chat_completion( File "/Users/ethanye/auto-GPT/scripts/llm_utils.py", line 28, in create_chat_completion response = openai.ChatCompletion.create( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create return super().create(*args, **kwargs) File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_requestor.py", line 216, in request result = self.request_raw( File "/Users/ethanye/anaconda3/lib/python3.10/site-packages/openai/api_requestor.py", line 529, in request_raw raise error.APIConnectionError( openai.error.APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) bash-3.2$

ethanye77 avatar Apr 14 '23 09:04 ethanye77

got the same issue here. Anybody with a suggestion?

iurp avatar Apr 21 '23 06:04 iurp

Hello there, i am having the exact same problem under Windows 11 home. I tried everything:

  • updating openai and certifi packages
  • check internet connection
  • check openai API status
  • allow python through firewall
  • verify that the API key is correct and not incorrect
  • stuff i even already compartmentalized right now.

But cannot get a connection to openai API.

armochillo avatar Apr 21 '23 17:04 armochillo

sam isssue. just thinking of it's api limitation on open api side? anyone tried to switch to 3.5?

Maziak2520 avatar Apr 24 '23 09:04 Maziak2520

By default, it points to 3.5 turbo only right @Maziak2520 image Did it work if, it is changed to just 3.5 ?

vinodkumartheking avatar Apr 24 '23 09:04 vinodkumartheking

I'm in believe it points to gpt-4 by default. Tried to change both to 3.5.. still testing..

Maziak2520 avatar Apr 24 '23 10:04 Maziak2520

same issue met. Anybody fixed it?

ilove2git avatar Apr 26 '23 08:04 ilove2git

Found the issue of it, It is mainly related to the openApi key used , under free tier the limits is expired. Check on the hits and limits on the keys. After creating a new account and key, it is working fine.

vinodkumartheking avatar Apr 26 '23 09:04 vinodkumartheking

Found the issue of it, It is mainly related to the openApi key used , under free tier the limits is expired. Check on the hits and limits on the keys. After creating a new account and key, it is working fine.

i'm paid account and use new key created but still failed with same error.

ilove2git avatar Apr 26 '23 13:04 ilove2git

Duplicate of #2241

Pwuts avatar Apr 26 '23 21:04 Pwuts