MetaGPT
MetaGPT copied to clipboard
Unable to use MetaGPT
sghanta@sghanta--MacBookPro16 metagpt % python3 startup.py "Create an app" 2023-10-25 23:50:20.302 | INFO | metagpt.config:init:44 - Config loading done. 2023-10-25 23:50:23.428 | INFO | metagpt.software_company:invest:39 - Investment: $3.0. 2023-10-25 23:50:23.429 | INFO | metagpt.roles.role:_act:167 - Alice(Product Manager): ready to WritePRD 2023-10-25 23:50:23.701 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 0.246(s), this was the 1st time calling it. 2023-10-25 23:50:24.792 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 1.337(s), this was the 2nd time calling it. 2023-10-25 23:50:25.883 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 2.428(s), this was the 3rd time calling it. 2023-10-25 23:50:25.883 | ERROR | metagpt.provider.openai_api:log_and_reraise:130 - Retry attempts exhausted. Last exception: Error communicating with OpenAI 2023-10-25 23:50:25.884 | WARNING | metagpt.provider.openai_api:log_and_reraise:131 - Recommend going to https://deepwisdom.feishu.cn/wiki/MsGnwQBjiif9c3koSJNcYaoSnu4#part-XdatdVlhEojeAfxaaEZcMV3ZniQ See FAQ 5.8
2023-10-25 23:50:26.978 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 0.094(s), this was the 1st time calling it. 2023-10-25 23:50:28.075 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 1.191(s), this was the 2nd time calling it. 2023-10-25 23:50:29.169 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 2.285(s), this was the 3rd time calling it. 2023-10-25 23:50:29.169 | ERROR | metagpt.provider.openai_api:log_and_reraise:130 - Retry attempts exhausted. Last exception: Error communicating with OpenAI 2023-10-25 23:50:29.169 | WARNING | metagpt.provider.openai_api:log_and_reraise:131 - Recommend going to https://deepwisdom.feishu.cn/wiki/MsGnwQBjiif9c3koSJNcYaoSnu4#part-XdatdVlhEojeAfxaaEZcMV3ZniQ See FAQ 5.8
2023-10-25 23:50:30.254 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 0.084(s), this was the 1st time calling it. 2023-10-25 23:50:31.350 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 1.180(s), this was the 2nd time calling it. 2023-10-25 23:50:32.456 | WARNING | tenacity.after:log_it:44 - Finished call to 'metagpt.provider.openai_api.OpenAIGPTAPI.acompletion_text' after 2.286(s), this was the 3rd time calling it. 2023-10-25 23:50:32.457 | ERROR | metagpt.provider.openai_api:log_and_reraise:130 - Retry attempts exhausted. Last exception: Error communicating with OpenAI 2023-10-25 23:50:32.457 | WARNING | metagpt.provider.openai_api:log_and_reraise:131 - Recommend going to https://deepwisdom.feishu.cn/wiki/MsGnwQBjiif9c3koSJNcYaoSnu4#part-XdatdVlhEojeAfxaaEZcMV3ZniQ See FAQ 5.8
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1112, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1145, in _create_connection_transport await waiter File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/sslproto.py", line 574, in _on_handshake_complete raise handshake_exc File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/sslproto.py", line 556, in _do_handshake self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 979, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/api_requestor.py", line 678, in arequest_raw result = await session.request(**request_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 982, in _wrap_create_connection raise ClientConnectorCertificateError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host api.openai.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)')]
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sghanta/Desktop/meta_gpt/metagpt/metagpt/actions/action.py", line 65, in _aask_v1 content = await self.llm.aask(prompt, system_msgs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sghanta/Desktop/meta_gpt/metagpt/metagpt/provider/base_gpt_api.py", line 44, in aask rsp = await self.acompletion_text(message, stream=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tenacity/_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tenacity/init.py", line 322, in iter return self.retry_error_callback(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sghanta/Desktop/meta_gpt/metagpt/metagpt/provider/openai_api.py", line 137, in log_and_reraise raise retry_state.outcome.exception() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sghanta/Desktop/meta_gpt/metagpt/metagpt/provider/openai_api.py", line 238, in acompletion_text return await self._achat_completion_stream(messages) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sghanta/Desktop/meta_gpt/metagpt/metagpt/provider/openai_api.py", line 163, in _achat_completion_stream response = await openai.ChatCompletion.acreate(**self._cons_kwargs(messages), stream=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 45, in acreate return await super().acreate(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 219, in acreate response, _, api_key = await requestor.arequest( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/api_requestor.py", line 374, in arequest result = await self.arequest_raw( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/api_requestor.py", line 695, in arequest_raw raise error.APIConnectionError("Error communicating with OpenAI") from e openai.error.APIConnectionError: Error communicating with OpenAI
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/sghanta/Desktop/meta_gpt/metagpt/startup.py", line 72, in
I see this is recommended approach "Have you try to run Install Certificates.command file in Python 3.x folder?"
but can't seem to figure out how to do this.
Seems to be a problem during the ssl certificate check.
Can you try to run this command openssl s_client -connect api.openai.com:443
to see if you mac is able to connect to openai? If it's not, you can try to update the ssl certificates running brew update & brew upgrade openssl
Thanks @antunsz , hmm looks like this is failing I did this: brew update & brew upgrade openssl , but still encounter the same issue.