MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

startup failed due to configuration

Open lswzzz opened this issue 2 years ago • 1 comments

配置出了问题,但不知道如何解决,麻烦大大帮忙看下 配置如下

if AZURE, check https://github.com/openai/openai-cookbook/blob/main/examples/azure/chat.ipynb

OPENAI_API_TYPE: "azure" OPENAI_BASE_URL: "https://xxx.openai.azure.com" OPENAI_API_KEY: "xxx" OPENAI_API_VERSION: "0613" DEPLOYMENT_NAME: "aiplus"

启动后出现如下错误 $ metagpt "create a 2048 game in python" 2024-01-06 22:06:50.647 | INFO | metagpt.const:get_metagpt_package_root:32 - Package root set to xxx 2024-01-06 22:06:54.998 | INFO | metagpt.config:get_default_llm_provider_enum:89 - OpenAI API Model: gpt-3.5-turbo-16k 2024-01-06 22:06:55.310 | INFO | metagpt.config:get_default_llm_provider_enum:89 - OpenAI API Model: gpt-3.5-turbo-16k 2024-01-06 22:06:55.600 | INFO | metagpt.config:get_default_llm_provider_enum:89 - OpenAI API Model: gpt-3.5-turbo-16k 2024-01-06 22:06:55.892 | INFO | metagpt.config:get_default_llm_provider_enum:89 - OpenAI API Model: gpt-3.5-turbo-16k 2024-01-06 22:06:56.194 | INFO | metagpt.team:invest:91 - Investment: $3.0. 2024-01-06 22:06:56.196 | INFO | metagpt.roles.role:_act:392 - Alice(Product Manager): to do PrepareDocuments() 2024-01-06 22:06:56.337 | INFO | metagpt.utils.file_repository:save:60 - save to: xxx 2024-01-06 22:06:56.346 | INFO | metagpt.roles.role:_act:392 - Alice(Product Manager): to do WritePRD() 2024-01-06 22:06:57.722 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 1.373(s), this was the 1st time calling it. exp: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} 2024-01-06 22:06:58.331 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 1.981(s), this was the 2nd time calling it. exp: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} 2024-01-06 22:06:59.662 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 3.313(s), this was the 3rd time calling it. exp: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} 2024-01-06 22:07:00.591 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 4.241(s), this was the 4th time calling it. exp: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} 2024-01-06 22:07:04.722 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 8.373(s), this was the 5th time calling it. exp: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} 2024-01-06 22:07:18.922 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 22.572(s), this was the 6th time calling it. exp: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} 2024-01-06 22:07:18.922 | WARNING | metagpt.utils.common:wrapper:505 - There is a exception in role's execution, in order to resume, we delete the newest role communication message in the role's memory. 2024-01-06 22:07:18.950 | ERROR | metagpt.utils.common:wrapper:487 - Exception occurs, start to serialize the project, exp: Traceback (most recent call last): File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/actions/action_node.py", line 265, in _aask_v1 content = await self.llm.aask(prompt, system_msgs) openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

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

Traceback (most recent call last): File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/utils/common.py", line 496, in wrapper return await func(self, *args, **kwargs) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/roles/role.py", line 542, in run rsp = await self.react() tenacity.RetryError: RetryError[<Future at 0x7fb7ee069cc0 state=finished raised NotFoundError>]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/utils/common.py", line 482, in wrapper result = await func(self, *args, **kwargs) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/team.py", line 134, in run await self.env.run() Exception: Traceback (most recent call last): File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/actions/action_node.py", line 265, in _aask_v1 content = await self.llm.aask(prompt, system_msgs) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/provider/base_gpt_api.py", line 53, in aask rsp = await self.acompletion_text(message, stream=stream) File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/init.py", line 314, in iter return fut.result() File "/Users/xxx/anaconda3/lib/python3.10/concurrent/futures/_base.py", line 451, in result return self.__get_result() File "/Users/xxx/anaconda3/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result raise self._exception File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/provider/openai_api.py", line 274, in acompletion_text return await self._achat_completion_stream(messages) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/provider/openai_api.py", line 211, in _achat_completion_stream response: AsyncStream[ChatCompletionChunk] = await self.async_client.chat.completions.create( File "/Users/xxx/anaconda3/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 1295, in create return await self._post( File "/Users/xxx/anaconda3/lib/python3.10/site-packages/openai/_base_client.py", line 1536, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) File "/Users/xxx/anaconda3/lib/python3.10/site-packages/openai/_base_client.py", line 1315, in request return await self._request( File "/Users/xxx/anaconda3/lib/python3.10/site-packages/openai/_base_client.py", line 1392, in _request raise self._make_status_error_from_response(err.response) from None openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

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

Traceback (most recent call last): File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/utils/common.py", line 496, in wrapper return await func(self, *args, **kwargs) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/roles/role.py", line 542, in run rsp = await self.react() File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/roles/role.py", line 493, in react rsp = await self._react() File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/roles/role.py", line 472, in _react rsp = await self._act() # 这个rsp是否需要publish_message? File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/roles/role.py", line 393, in _act response = await self._rc.todo.run(self._rc.history) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/actions/write_prd.py", line 105, in run prd_doc = await self._update_prd( File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/actions/write_prd.py", line 146, in _update_prd prd = await self._run_new_requirement( File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/actions/write_prd.py", line 126, in _run_new_requirement node = await WRITE_PRD_NODE.fill(context=context, llm=self.llm, schema=schema) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/actions/action_node.py", line 331, in fill return await self.simple_fill(schema=schema, mode=mode) File "/Users/xxx/AIWorkspace/MetaGPT/metagpt/actions/action_node.py", line 298, in simple_fill content, scontent = await self._aask_v1(prompt, class_name, mapping, schema=schema) File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "/Users/xxx/anaconda3/lib/python3.10/site-packages/tenacity/init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x7fb7ee069cc0 state=finished raised NotFoundError>]

lswzzz avatar Jan 06 '24 14:01 lswzzz

报错404,Resource not found 请检查确认下 azure 配置,尤其是 OPENAI_API_VERSION 和 DEPLOYMENT_NAME 是否存在。

voidking avatar Jan 16 '24 03:01 voidking