MetaGPT
MetaGPT copied to clipboard
2023-12-14 23:17:23.957 | ERROR | metagpt.utils.utils:log_it:16 - Finished call to 'metagpt.actions.action.Action._aask_v1' after 52.073(s), this was the 1st time calling it. exp: RetryError[<Future at 0x1371c6220 state=finished raised JSONDecodeError>]
keep getting this issue, guys anything would be helpful? 有没有大佬给看看 谢谢
2023-12-14 23:17:23.956 | WARNING | metagpt.utils.repair_llm_raw_output:run_and_passon:231 - parse json from content inside [CONTENT][/CONTENT] failed at retry 1, try to fix it, exp: Expecting ',' delimiter: line 74 column 5 (char 2911) 2023-12-14 23:17:23.957 | INFO | metagpt.utils.repair_llm_raw_output:repair_invalid_json:202 - repair_invalid_json, raw error: Expecting ',' delimiter: line 74 column 5 (char 2911) 2023-12-14 23:17:23.957 | ERROR | metagpt.utils.utils:log_it:16 - Finished call to 'metagpt.actions.action.Action._aask_v1' after 52.073(s), this was the 1st time calling it. exp: RetryError[<Future at 0x1371c6220 state=finished raised JSONDecodeError>] /CONTENT] [CONTENT]
the same problem
Which llm do you use?
The excepted result is a valid json str but some llm sometimes can't generate the excepted one and then cause a json parse error. So you can run again.
Or use the experimental configuration to add REPAIR_LLM_OUTPUT: true
in key.yaml
which refs to https://github.com/geekan/MetaGPT-docs/blob/main/src/zh/guide/tutorials/integration_with_open_llm.md#%E5%8F%AF%E9%80%89%E7%9A%84%E4%BF%AE%E5%A4%8Dllm%E8%BE%93%E5%87%BA%E7%BB%93%E6%9E%9C
.
#500 merged llm output fix
@geekan hi I have a question how can we exactly configure the metagpt with ollama model codellama with the help of litellm? i did this but got an error:
(metagpt) (base) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/Metagpt/metagpt$ python3 startup.py "create a 2048 game in python"
2023-12-22 07:54:18.833 | INFO | metagpt.const:get_metagpt_package_root:32 - Package root set to /mnt/c/Users/Hp/autogen_wsl/Metagpt/metagpt
2023-12-22 07:54:19.498 | INFO | metagpt.config:get_default_llm_provider_enum:88 - OpenAI API Model: gpt-4-1106-preview
2023-12-22 07:54:20.167 | INFO | metagpt.team:invest:84 - Investment: $3.0.
2023-12-22 07:54:20.171 | INFO | metagpt.roles.role:_act:379 - Alice(Product Manager): ready to PrepareDocuments
2023-12-22 07:54:20.968 | INFO | metagpt.utils.file_repository:save:60 - save to: /mnt/c/Users/Hp/autogen_wsl/Metagpt/metagpt/workspace/20231222075420/docs/requirement.txt
2023-12-22 07:54:20.976 | INFO | metagpt.roles.role:_act:379 - Alice(Product Manager): ready to WritePRD
2023-12-22 07:54:21.328 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 0.331(s), this was the 1st time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:54:21.817 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 0.820(s), this was the 2nd time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:54:23.104 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 2.108(s), this was the 3rd time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:54:23.595 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 2.599(s), this was the 4th time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:54:31.694 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 10.698(s), this was the 5th time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:54:43.644 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 22.648(s), this was the 6th time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:54:43.645 | 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.
2023-12-22 07:54:43.648 | ERROR | metagpt.utils.common:wrapper:487 - Exception occurs, start to serialize the project, exp:
Traceback (most recent call last):
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 256, in _aask_v1
content = await self.llm.aask(prompt, system_msgs)
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/utils/common.py", line 496, in wrapper return await func(self, *args, **kwargs) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 528, in run rsp = await self.react() tenacity.RetryError: RetryError[<Future at 0x7f3c64cd9d00 state=finished raised NotFoundError>]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/utils/common.py", line 482, in wrapper
result = await func(self, *args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/team.py", line 124, in run
await self.env.run()
Exception: Traceback (most recent call last):
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 256, in _aask_v1
content = await self.llm.aask(prompt, system_msgs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/provider/base_gpt_api.py", line 53, in aask
rsp = await self.acompletion_text(message, stream=stream)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/init.py", line 314, in iter
return fut.result()
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/provider/openai_api.py", line 274, in acompletion_text
return await self._achat_completion_stream(messages)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/provider/openai_api.py", line 211, in _achat_completion_stream
response: AsyncStream[ChatCompletionChunk] = await self.async_client.chat.completions.create(
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/openai/resources/chat/completions.py", line 1295, in create
return await self._post(
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/openai/_base_client.py", line 1536, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/openai/_base_client.py", line 1315, in request
return await self._request(
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/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': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/utils/common.py", line 496, in wrapper return await func(self, *args, **kwargs) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 528, in run rsp = await self.react() File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 479, in react rsp = await self._react() File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 459, in _react rsp = await self._act() # 这个rsp是否需要publish_message? File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 380, in _act response = await self._rc.todo.run(self._rc.important_memory) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/write_prd.py", line 105, in run prd_doc = await self._update_prd( File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/write_prd.py", line 146, in _update_prd prd = await self._run_new_requirement( File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/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 "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 314, in fill return await self.simple_fill(schema, mode) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 288, in simple_fill content, scontent = await self._aask_v1(prompt, class_name, mapping, schema=schema) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x7f3c64cd9d00 state=finished raised NotFoundError>]
(metagpt) (base) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/Metagpt/metagpt$ python3 startup.py "write a cli snake game based on pygame"
2023-12-22 07:56:53.788 | INFO | metagpt.const:get_metagpt_package_root:32 - Package root set to /mnt/c/Users/Hp/autogen_wsl/Metagpt/metagpt
2023-12-22 07:56:54.466 | INFO | metagpt.config:get_default_llm_provider_enum:88 - OpenAI API Model: gpt-4-1106-preview
2023-12-22 07:56:55.354 | INFO | metagpt.team:invest:84 - Investment: $3.0.
2023-12-22 07:56:55.359 | INFO | metagpt.roles.role:_act:379 - Alice(Product Manager): ready to PrepareDocuments
2023-12-22 07:56:56.172 | INFO | metagpt.utils.file_repository:save:60 - save to: /mnt/c/Users/Hp/autogen_wsl/Metagpt/metagpt/workspace/20231222075655/docs/requirement.txt
2023-12-22 07:56:56.189 | INFO | metagpt.roles.role:_act:379 - Alice(Product Manager): ready to WritePRD
2023-12-22 07:56:56.487 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 0.280(s), this was the 1st time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:56:56.834 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 0.628(s), this was the 2nd time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:56:57.237 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 1.031(s), this was the 3rd time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:56:59.864 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 3.658(s), this was the 4th time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:57:05.290 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 9.084(s), this was the 5th time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:57:16.715 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 20.509(s), this was the 6th time calling it. exp: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
2023-12-22 07:57:16.716 | 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.
2023-12-22 07:57:16.721 | ERROR | metagpt.utils.common:wrapper:487 - Exception occurs, start to serialize the project, exp:
Traceback (most recent call last):
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 256, in _aask_v1
content = await self.llm.aask(prompt, system_msgs)
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/utils/common.py", line 496, in wrapper return await func(self, *args, **kwargs) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 528, in run rsp = await self.react() tenacity.RetryError: RetryError[<Future at 0x7f55df693eb0 state=finished raised NotFoundError>]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/utils/common.py", line 482, in wrapper
result = await func(self, *args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/team.py", line 124, in run
await self.env.run()
Exception: Traceback (most recent call last):
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 256, in _aask_v1
content = await self.llm.aask(prompt, system_msgs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/provider/base_gpt_api.py", line 53, in aask
rsp = await self.acompletion_text(message, stream=stream)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/init.py", line 314, in iter
return fut.result()
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/provider/openai_api.py", line 274, in acompletion_text
return await self._achat_completion_stream(messages)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/provider/openai_api.py", line 211, in _achat_completion_stream
response: AsyncStream[ChatCompletionChunk] = await self.async_client.chat.completions.create(
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/openai/resources/chat/completions.py", line 1295, in create
return await self._post(
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/openai/_base_client.py", line 1536, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/openai/_base_client.py", line 1315, in request
return await self._request(
File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/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': {'message': 'The model gpt-4-1106-preview
does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/utils/common.py", line 496, in wrapper return await func(self, *args, **kwargs) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 528, in run rsp = await self.react() File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 479, in react rsp = await self._react() File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 459, in _react rsp = await self._act() # 这个rsp是否需要publish_message? File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/roles/role.py", line 380, in _act response = await self._rc.todo.run(self._rc.important_memory) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/write_prd.py", line 105, in run prd_doc = await self._update_prd( File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/write_prd.py", line 146, in _update_prd prd = await self._run_new_requirement( File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/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 "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 314, in fill return await self.simple_fill(schema, mode) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt-0.5.2-py3.9.egg/metagpt/actions/action_node.py", line 288, in simple_fill content, scontent = await self._aask_v1(prompt, class_name, mapping, schema=schema) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "/home/maryam_linux/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x7f55df693eb0 state=finished raised NotFoundError>]
@MARYAMJAHANIR
copy the config/config.yaml
to config.key.yaml
and add below content refs to https://docs.deepwisdom.ai/main/en/guide/tutorials/integration_with_open_llm.html#ollama-api-interface
OLLAMA_API_BASE: 'http://127.0.0.1:11434/api' # 11434 is default port
OLLAMA_API_MODEL: 'codellama'
and commented the fields starts with OPENAI_xxx
in the key.yaml.
Any further problems, welcome to comment.
@better629 Thank you so much, it helped me a lot but faced new timeout error any idea how can i resolve this: (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/MetaGPT/metagpt$ cd MetaGPT bash: cd: MetaGPT: No such file or directory (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/MetaGPT/metagpt$ metagpt "write a cli snake game based on pygame" 2023-12-24 03:01:22.265 | INFO | metagpt.const:get_metagpt_package_root:32 - Package root set to /mnt/c/Users/Hp/autogen_wsl/MetaGPT/metagpt 2023-12-24 03:01:27.086 | INFO | metagpt.team:invest:91 - Investment: $3.0. 2023-12-24 03:01:27.092 | INFO | metagpt.roles.role:_act:392 - Alice(Product Manager): to do PrepareDocuments() 2023-12-24 03:01:28.303 | INFO | metagpt.utils.file_repository:save:60 - save to: /mnt/c/Users/Hp/autogen_wsl/MetaGPT/metagpt/workspace/20231224030127/docs/requirement.txt 2023-12-24 03:01:28.339 | INFO | metagpt.roles.role:_act:392 - Alice(Product Manager): to do WritePRD() 2023-12-24 03:06:28.746 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 300.356(s), this was the 1st time calling it. exp: Request timed out. 2023-12-24 03:11:30.746 | ERROR | metagpt.utils.common:log_it:433 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 602.357(s), this was the 2nd time calling it. exp: Request timed out.
@MARYAMJAHANIR Do you start ollama in local machine or remote machine. It starts with 127.0.0.1:11434 in local machine. If you start it in remote machine, you can refs to https://docs.deepwisdom.ai/main/en/guide/tutorials/integration_with_open_llm.html#non-local-access
@better629 I apologize for the long text, but just for clarification, In my situation, i am using ollama model codellama with litellm: C:\Windows\system32>wsl --install Ubuntu is already installed. Launching Ubuntu... (base) maryam_linux@Maryam:~$ cd /mnt/c/Users/Hp/autogen_wsl (base) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl$ conda activate metagpt (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl$ cd MetaGPT (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/MetaGPT$ cd metagpt (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/MetaGPT/metagpt$ litelm --model ollama/codellama litelm: command not found (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/MetaGPT/metagpt$ litellm --model ollama/codellama INFO: Started server process [3609] INFO: Waiting for application startup.
#------------------------------------------------------------#
'A feature I really want is...'
https://github.com/BerriAI/litellm/issues/new
#------------------------------------------------------------#
Thank you for using LiteLLM! - Krrish & Ishaan Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new LiteLLM: Test your local proxy with: "litellm --test" This runs an openai.ChatCompletion request to your proxy [In a new terminal tab] LiteLLM: Curl Command Test for your local proxy
curl --location 'http://0.0.0.0:8000/chat/completions'
--header 'Content-Type: application/json'
--data ' {
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "what llm are you"
}
]
}'
Docs: https://docs.litellm.ai/docs/simple_proxy
See all Router/Swagger docs on http://0.0.0.0:8000
INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
and on the other terminal I ran ollama serve: C:\Windows\system32>wsl --install Ubuntu is already installed. Launching Ubuntu... (base) maryam_linux@Maryam:~$ cd /mnt/c/Users/Hp/autogen_wsl (base) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl$ conda activate metagpt (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl$ cd MetaGPT (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/MetaGPT$ cd metagpt (metagpt) maryam_linux@Maryam:/mnt/c/Users/Hp/autogen_wsl/MetaGPT/metagpt$ ollama serve 2023/12/24 17:49:02 images.go:737: total blobs: 14 2023/12/24 17:49:02 images.go:744: total unused blobs removed: 0 2023/12/24 17:49:02 routes.go:870: Listening on 127.0.0.1:11434 (version 0.1.15)
now how can I edit my config.yaml to access the codellama model of ollama?
@MARYAMJAHANIR same as https://github.com/geekan/MetaGPT/issues/614 .
We haven't tested/supported with litellm yet. But according to the https://github.com/BerriAI/litellm?tab=readme-ov-file#step-2-replace-openai-base
, it seems that it's openai api compatible.
Maybe you can set in config/key.yaml
OPEN_LLM_API_BASE: 'http://0.0.0.0:8000'
OPEN_LLM_API_MODEL: 'your_model'
also use the MetaGPT dev branch.
"Create a 2048 game in python"
2024-01-08 17:25:43.349 | INFO | metagpt.const:get_metagpt_package_root:32 - Package root set to /Users/metagpt/software/ml/MetaGPT
2024-01-08 17:25:43.573 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI
2024-01-08 17:25:45.520 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI
2024-01-08 17:25:45.531 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI
2024-01-08 17:25:45.537 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI
2024-01-08 17:25:45.545 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI
2024-01-08 17:25:45.545 | INFO | metagpt.team:invest:86 - Investment: $3.0.
2024-01-08 17:25:45.547 | INFO | metagpt.roles.role:_act:357 - Alice(Product Manager): to do PrepareDocuments(PrepareDocuments)
2024-01-08 17:25:45.638 | INFO | metagpt.utils.file_repository:save:60 - save to: /Users/metagpt/software/ml/MetaGPT/workspace/20240108172545/docs/requirement.txt
2024-01-08 17:25:45.642 | INFO | metagpt.roles.role:_act:357 - Alice(Product Manager): to do WritePRD(WritePRD)
[CONTENT]
{
"Language": "en_us",
"Programming Language": "Python",
"Original Requirements": "Create a 2048 game in python",
"Project Name": "2048_game",
"Product Goals": [
"Engaging and responsive user experience",
"Beautiful UI design",
"Simple and efficient game algorithm"
],
"User Stories": [
"As a player, I want to choose between different difficulty levels",
"As a player, I want to see my score after each game",
"As a player, I want a restart button available when I lose",
"As a player, I want a visually appealing UI that enhances my gaming experience",
"As a player, I want to play the game on mobile devices"
],
"Competitive Analysis": [
"2048 Game A: Simple interface, lacks responsive features",
"play2048.co: Beautiful and responsive UI with high score tracking",
"2048game.com: Responsive UI with high score tracking, but many ads",
"2048 Mobile App: Comprehensive game features, but paid",
"Free2048: Ads-free game, but limited features"
],
"Competitive Quadrant Chart": "quadrantChart\n title "Reach and engagement of campaigns"\n x-axis "Low Reach" --> "High Reach"\n y-axis "Low Engagement" --> "High Engagement"\n quadrant-1 "We should expand"\n quadrant-2 "Need to promote"\n quadrant-3 "Re-evaluate"\n quadrant-4 "May be improved"\n "Campaign A": [0.3, 0.6]\n "Campaign B": [0.45, 0.23]\n "Campaign C": [0.57, 0.69]\n "Campaign D": [0.78, 0.34]\n "Campaign E": [0.40, 0.34]\n "Campaign F": [0.35, 0.78]\n "Our Target Product": [0.5, 0.6]",
"Requirement Analysis": "The project requires a robust game algorithm, a responsive UI, and a clear high score tracking system. The UI should be visually appealing and compatible with mobile devices. The game should have multiple difficulty levels and a simple restart mechanism.",
"Requirement Pool": [
[
"P0",
"The main code should include a well-designed game algorithm that ensures the game is both challenging and fun for players."
],
[
"P1",
"The UI should be responsive and visually appealing, providing a smooth gaming experience on various devices."
],
[
"P2",
"The game should track and display the player's high score, encouraging them to improve their performance."
],
[
"P3",
"The game should offer multiple difficulty levels to cater to players of different skill levels."
],
[
"P4",
"A restart button should be available to players when they lose, allowing them to easily start a new game."
]
],
"UI Design draft": "The UI should include a game board with tiles representing numbers from 2 to 2048. The player's current score should be displayed prominently on the board. A menu button should provide access to game settings, including difficulty selection and sound controls. The game board should be responsive and adapt to different screen sizes.",
"Anything UNCLEAR": ""
}
[/CONTENT]
2024-01-08 17:26:26.848 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1119, completion_tokens: 891
2024-01-08 17:26:26.857 | INFO | metagpt.utils.git_repository:rename_root:200 - Delete directory /Users/metagpt/software/ml/MetaGPT/workspace/2048_game
2024-01-08 17:26:26.865 | INFO | metagpt.utils.git_repository:rename_root:206 - Rename directory /Users/metagpt/software/ml/MetaGPT/workspace/20240108172545 to /Users/metagpt/software/ml/MetaGPT/workspace/2048_game
2024-01-08 17:26:26.869 | INFO | metagpt.utils.file_repository:save:60 - save to: /Users/metagpt/software/ml/MetaGPT/workspace/2048_game/docs/prds/20240108172626.json
no mermaid
2024-01-08 17:26:26.877 | WARNING | metagpt.utils.mermaid:mermaid_to_file:41 - RUN npm install -g @mermaid-js/mermaid-cli
to install mmdc,or consider changing MERMAID_ENGINE to playwright
, pyppeteer
, or ink
.
2024-01-08 17:26:26.878 | INFO | metagpt.utils.file_repository:save:60 - save to: /Users/metagpt/software/ml/MetaGPT/workspace/2048_game/resources/prd/20240108172626.md
2024-01-08 17:26:26.882 | INFO | metagpt.roles.role:_act:357 - Bob(Architect): to do WriteDesign(WriteDesign)
[CONTENT]
{
"Implementation approach": "We will use Python's built-in turtle module to create the game board and implement the game logic. The game will be designed to be responsive using CSS media queries and mobile-first approach. High score tracking will be implemented using a simple dictionary.",
"File list": [
"main.py",
"game.py",
"ui.py",
"high_scores.py"
],
"Data structures and interfaces": "\nclass Diagram
class GameBoard
- tiles: List[Tile]
+ create_board()
+ place_tile(position: str, value: int)
+ clear_board()
class Tile
- position: str
- value: int
- frozen: bool
+ update_value(new_value: int)
class HighScores
- scores: Dict[int, int]
+ add_score(score: int)
+ get_high_score()
class UI
- game_board: GameBoard
- high_scores: HighScores
+ render_board(game_board: GameBoard)
+ render_high_scores(high_scores: HighScores)
+ show_menu()
main -> UI: start_game()
UI -> GameBoard: place_tile()
UI -> GameBoard: clear_board()
UI -> HighScores: add_score()
UI -> HighScores: get_high_score()
GameBoard -> Tile: update_value()
HighScores -> UI: render_high_scores()
",
"Program call flow": "\nsequenceDiagram
participant M as Main
participant UI as UI
participant GB as GameBoard
participant HS as HighScores
M->>UI: start_game
UI->>GB: place_tile
UI->>GB: clear_board
UI->>HS: add_score
UI->>HS: get_high_score
GB->>Tile: update_value
HS->>UI: render_high_scores
",
"Anything UNCLEAR": "None"
}
[/CONTENT]
2024-01-08 17:26:54.881 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1612, completion_tokens: 557
2024-01-08 17:26:54.887 | INFO | metagpt.utils.file_repository:save:60 - save to: /Users/metagpt/software/ml/MetaGPT/workspace/2048_game/docs/system_design/20240108172626.json
2024-01-08 17:26:54.889 | INFO | metagpt.utils.file_repository:save:65 - update dependency: /Users/metagpt/software/ml/MetaGPT/workspace/2048_game/docs/system_design/20240108172626.json:{'docs/prds/20240108172626.json'}
no mermaid
2024-01-08 17:26:54.896 | WARNING | metagpt.utils.mermaid:mermaid_to_file:41 - RUN npm install -g @mermaid-js/mermaid-cli
to install mmdc,or consider changing MERMAID_ENGINE to playwright
, pyppeteer
, or ink
.
2024-01-08 17:26:54.896 | INFO | metagpt.actions.design_api:_save_data_api_design:117 - Save class view to /Users/metagpt/software/ml/MetaGPT/workspace/2048_game/resources/data_api_design/20240108172626
no mermaid
2024-01-08 17:26:54.903 | WARNING | metagpt.utils.mermaid:mermaid_to_file:41 - RUN npm install -g @mermaid-js/mermaid-cli
to install mmdc,or consider changing MERMAID_ENGINE to playwright
, pyppeteer
, or ink
.
2024-01-08 17:26:54.903 | INFO | metagpt.actions.design_api:_save_seq_flow:127 - Saving sequence flow to /Users/metagpt/software/ml/MetaGPT/workspace/2048_game/resources/seq_flow/20240108172626
2024-01-08 17:26:54.905 | INFO | metagpt.utils.file_repository:save:60 - save to: /Users/metagpt/software/ml/MetaGPT/workspace/2048_game/resources/system_design/20240108172626.md
2024-01-08 17:26:54.909 | INFO | metagpt.roles.role:_act:357 - Eve(Project Manager): to do WriteTasks(WriteTasks)
[CONTENT]
{
"Implementation approach": "We will use Python's built-in turtle module to create the game board and implement the game logic. The game will be designed to be responsive using CSS media queries and mobile-first approach. High score tracking will be implemented using a simple dictionary.",
"File list": ["main.py", "game.py", "ui.py", "high_scores.py"],
"Data structures and interfaces": "\nclass Diagram\n class GameBoard\n - tiles: List[Tile]\n + create_board()\n + place_tile(position: str, value: int)\n + clear_board()\n \n class Tile\n - position: str\n - value: int\n - frozen: bool\n + update_value(new_value: int)\n \n class HighScores\n - scores: Dict[int, int]\n + add_score(score: int)\n + get_high_score()\n \n class UI\n - game_board: GameBoard\n - high_scores: HighScores\n + render_board(game_board: GameBoard)\n + render_high_scores(high_scores: HighScores)\n + show_menu()\n \n main -> UI: start_game()\n UI -> GameBoard: place_tile()\n UI -> GameBoard: clear_board()\n UI -> HighScores: add_score()\n UI -> HighScores: get_high_score()\n \n GameBoard -> Tile: update_value()\n HighScores -> UI: render_high_scores()\n ",
"Program call flow": "\nsequenceDiagram\n participant M as Main\n participant UI as UI\n participant GB as GameBoard\n participant HS as HighScores\n M->>UI: start_game\n UI->>GB: place_tile\n UI->>GB: clear_board\n UI->>HS: add_score\n UI->>HS: get_high_score\n GB->>Tile: update_value\n HS->>UI: render_high_scores\n ",
"Anything UNCLEAR": "None"
}
[/CONTENT]
[Nodes] [1]
- File: main.py
- Type: Python script
- Instructions: Implement the main function, import the game, UI, and high_scores classes, and start the game.
- Dependencies: game.py, ui.py, high_scores.py
- Clearance: 1
[2]
- File: game.py
- Type: Python script
- Instructions: Contain the Game class and its functions, such as create_board, place_tile, clear_board, and update_value.
- Dependencies: None
- Clearance: 2
[3]
- File: ui.py
- Type: Python script
- Instructions: Implement the UI class with functions to render the game board, high scores, and show the menu.
- Dependencies: game.py, high_scores.py
- Clearance: 3
[4]
- File: high_scores.py
- Type: Python script
- Instructions: Implement the HighScores class to manage high scores and provide functions to add scores and get the highest score.
- Dependencies: None
- Clearance: 4
[Task list]
- game.py
- main.py
[Full API spec]
- OpenAPI 3.0 spec for API documentation (if applicable): None
[Shared Knowledge]
- game.py: Contains functions shared across the project.
[Anything UNCLEAR]
- None 2024-01-08 17:27:39.170 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.002 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1104, completion_tokens: 930 2024-01-08 17:27:39.176 | ERROR | metagpt.utils.common:log_it:438 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 44.206(s), this was the 1st time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [CONTENT] { "Implementation approach": "We will use Python's built-in turtle module to create the game board and implement the game logic. The game will be designed to be responsive using CSS media queries and mobile-first approach. High score tracking will be implemented using a simple dictionary.", "File list": ["main.py", "game.py", "ui.py", "high_scores.py"], "Data structures and interfaces": "\nclass Diagram\n class GameBoard\n - tiles: List[Tile]\n + create_board()\n + place_tile(position: str, value: int)\n + clear_board()\n \n class Tile\n - position: str\n - value: int\n - frozen: bool\n + update_value(new_value: int)\n \n class HighScores\n - scores: Dict[int, int]\n + add_score(score: int)\n + get_high_score()\n \n class UI\n - game_board: GameBoard\n - high_scores: HighScores\n + render_board(game_board: GameBoard)\n + render_high_scores(high_scores: HighScores)\n + show_menu()\n \n main -> UI: start_game()\n UI -> GameBoard: place_tile()\n UI -> GameBoard: clear_board()\n UI -> HighScores: add_score()\n UI -> HighScores: get_high_score()\n \n GameBoard -> Tile: update_value()\n HighScores -> UI: render_high_scores()\n ", "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant UI as UI\n participant GB as GameBoard\n participant HS as HighScores\n M->>UI: start_game\n UI->>GB: place_tile\n UI->>GB: clear_board\n UI->>HS: add_score\n UI->>HS: get_high_score\n GB->>Tile: update_value\n HS->>UI: render_high_scores\n ", "Anything UNCLEAR": "None" } [/CONTENT]
[Nodes] [1]
- File: main.py
- Type: Python script
- Instruction: Implement the main function, import the game, UI, and high_scores classes, and start the game.
[2]
- File: game.py
- Type: Python script
- Instruction: Contains the Game class and its functions, including creating the game board, placing tiles, and updating tile values.
[3]
- File: ui.py
- Type: Python script
- Instruction: Implement the UI class with functions to render the game board, high scores, and a menu.
[4]
- File: high_scores.py
- Type: Python script
- Instruction: Implement the HighScores class to store and manage high scores.
[5]
- File: main.py
- Type: Python script
- Instruction: Implement the start_game function, which initializes the game, UI, and high_scores objects.
[6]
- File: ui.py
- Type: Python script
- Instruction: Implement the render_board function, which draws the game board using the turtle module.
[7]
- File: ui.py
- Type: Python script
- Instruction: Implement the render_high_scores function, which displays the high scores in the UI.
[8]
- File: ui.py
- Type: Python script
- Instruction: Implement the show_menu function, which displays a menu for the user to choose between placing a tile or clearing the board.
[9]
- File: game.py
- Type: Python script
- Instruction: Implement the place_tile function, which places a tile at the specified position and updates its value.
[10]
- File: game.py
- Type: Python script
- Instruction: Implement the clear_board function, which clears all tiles from the game board.
[11]
- File 2024-01-08 17:29:01.141 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.002 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1104, completion_tokens: 1024 2024-01-08 17:29:01.145 | ERROR | metagpt.utils.common:log_it:438 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 126.175(s), this was the 2nd time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [CONTENT] { "Implementation approach": "We will use Python's built-in turtle module to create the game board and implement the game logic. The game will be designed to be responsive using CSS media queries and mobile-first approach. High score tracking will be implemented using a simple dictionary.", "File list": ["main.py", "game.py", "ui.py", "high_scores.py"], "Data structures and interfaces": "\nclass Diagram\n class GameBoard\n - tiles: List[Tile]\n + create_board()\n + place_tile(position: str, value: int)\n + clear_board()\n \n class Tile\n - position: str\n - value: int\n - frozen: bool\n + update_value(new_value: int)\n \n class HighScores\n - scores: Dict[int, int]\n + add_score(score: int)\n + get_high_score()\n \n class UI\n - game_board: GameBoard\n - high_scores: HighScores\n + render_board(game_board: GameBoard)\n + render_high_scores(high_scores: HighScores)\n + show_menu()\n \n main -> UI: start_game()\n UI -> GameBoard: place_tile()\n UI -> GameBoard: clear_board()\n UI -> HighScores: add_score()\n UI -> HighScores: get_high_score()\n \n GameBoard -> Tile: update_value()\n HighScores -> UI: render_high_scores()\n ", "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant UI as UI\n participant GB as GameBoard\n participant HS as HighScores\n M->>UI: start_game\n UI->>GB: place_tile\n UI->>GB: clear_board\n UI->>HS: add_score\n UI->>HS: get_high_score\n GB->>Tile: update_value\n HS->>UI: render_high_scores\n ", "Anything UNCLEAR": "None" } [/CONTENT]
[Nodes] [1]
- File: main.py
- Type: Python script
- Instructions: Implement the main function, import the game, UI, and high_scores classes, and start the game.
- Dependencies: game.py, ui.py, high_scores.py
- Clearance: 1
[2]
- File: game.py
- Type: Python script
- Instructions: Contain the Game class and its functions, such as create_board, place_tile, clear_board, and update_value.
- Dependencies: None
- Clearance: 2
[3]
- File: ui.py
- Type: Python script
- Instructions: Implement the UI class with functions to render the game board, high scores, and show the menu.
- Dependencies: game.py, high_scores.py
- Clearance: 3
[4]
- File: high_scores.py
- Type: Python script
- Instructions: Implement the HighScores class to manage high scores and provide functions to add scores and get the highest score.
- Dependencies: None
- Clearance: 4
[Task list]
- game.py
- main.py
[Full API spec]
- OpenAPI 3.0 spec for API documentation (if applicable): None
[Shared Knowledge]
- game.py: Contains functions shared across the project.
[Anything UNCLEAR]
- None 2024-01-08 17:30:11.882 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.003 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1104, completion_tokens: 930 2024-01-08 17:30:11.886 | ERROR | metagpt.utils.common:log_it:438 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 196.915(s), this was the 3rd time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [CONTENT] { "Implementation approach": "We will use Python's built-in turtle module to create the game board and implement the game logic. The game will be designed to be responsive using CSS media queries and mobile-first approach. High score tracking will be implemented using a simple dictionary.", "File list": ["main.py", "game.py", "ui.py", "high_scores.py"], "Data structures and interfaces": "\nclass Diagram\n class GameBoard\n - tiles: List[Tile]\n + create_board()\n + place_tile(position: str, value: int)\n + clear_board()\n \n class Tile\n - position: str\n - value: int\n - frozen: bool\n + update_value(new_value: int)\n \n class HighScores\n - scores: Dict[int, int]\n + add_score(score: int)\n + get_high_score()\n \n class UI\n - game_board: GameBoard\n - high_scores: HighScores\n + render_board(game_board: GameBoard)\n + render_high_scores(high_scores: HighScores)\n + show_menu()\n \n main -> UI: start_game()\n UI -> GameBoard: place_tile()\n UI -> GameBoard: clear_board()\n UI -> HighScores: add_score()\n UI -> HighScores: get_high_score()\n \n GameBoard -> Tile: update_value()\n HighScores -> UI: render_high_scores()\n ", "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant UI as UI\n participant GB as GameBoard\n participant HS as HighScores\n M->>UI: start_game\n UI->>GB: place_tile\n UI->>GB: clear_board\n UI->>HS: add_score\n UI->>HS: get_high_score\n GB->>Tile: update_value\n HS->>UI: render_high_scores\n ", "Anything UNCLEAR": "None" } [/CONTENT]
[Nodes] [1]
- File: main.py
- Type: Python script
- Instructions: Implement the main function, import the game, UI, and high_scores classes, and start the game.
- Dependencies: game.py, ui.py, high_scores.py
- Clearance: 1
[2]
- File: game.py
- Type: Python script
- Instructions: Contain the Game class and its functions, such as create_board, place_tile, clear_board, and update_value.
- Dependencies: None
- Clearance: 2
[3]
- File: ui.py
- Type: Python script
- Instructions: Implement the UI class with functions to render the game board, high scores, and show the menu.
- Dependencies: game.py, high_scores.py
- Clearance: 3
[4]
- File: high_scores.py
- Type: Python script
- Instructions: Implement the HighScores class to manage high scores and provide functions to add scores and get the highest score.
- Dependencies: None
- Clearance: 4
[Task list]
- game.py
- main.py
[Full API spec]
- OpenAPI 3.0 spec for API documentation (if applicable): None
[Shared Knowledge]
- game.py: Contains functions shared across the project.
[Anything UNCLEAR]
- None 2024-01-08 17:31:01.946 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.004 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1104, completion_tokens: 930 2024-01-08 17:31:01.952 | ERROR | metagpt.utils.common:log_it:438 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 246.980(s), this was the 4th time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [CONTENT] { "Implementation approach": "We will use Python's built-in turtle module to create the game board and implement the game logic. The game will be designed to be responsive using CSS media queries and mobile-first approach. High score tracking will be implemented using a simple dictionary.", "File list": ["main.py", "game.py", "ui.py", "high_scores.py"], "Data structures and interfaces": "\nclass Diagram\n class GameBoard\n - tiles: List[Tile]\n + create_board()\n + place_tile(position: str, value: int)\n + clear_board()\n \n class Tile\n - position: str\n - value: int\n - frozen: bool\n + update_value(new_value: int)\n \n class HighScores\n - scores: Dict[int, int]\n + add_score(score: int)\n + get_high_score()\n \n class UI\n - game_board: GameBoard\n - high_scores: HighScores\n + render_board(game_board: GameBoard)\n + render_high_scores(high_scores: HighScores)\n + show_menu()\n \n main -> UI: start_game()\n UI -> GameBoard: place_tile()\n UI -> GameBoard: clear_board()\n UI -> HighScores: add_score()\n UI -> HighScores: get_high_score()\n \n GameBoard -> Tile: update_value()\n HighScores -> UI: render_high_scores()\n ", "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant UI as UI\n participant GB as GameBoard\n participant HS as HighScores\n M->>UI: start_game\n UI->>GB: place_tile\n UI->>GB: clear_board\n UI->>HS: add_score\n UI->>HS: get_high_score\n GB->>Tile: update_value\n HS->>UI: render_high_scores\n ", "Anything UNCLEAR": "None" } [/CONTENT]
[Nodes] [1]
- File: main.py
- Type: Python script
- Instructions: Implement the main function, import the game, UI, and high_scores classes, and start the game.
- Dependencies: game.py, ui.py, high_scores.py
- Clearance: 1
[2]
- File: game.py
- Type: Python script
- Instructions: Contain the Game class and its functions, such as create_board, place_tile, clear_board, and update_value.
- Dependencies: None
- Clearance: 2
[3]
- File: ui.py
- Type: Python script
- Instructions: Implement the UI class with functions to render the game board, high scores, and show the menu.
- Dependencies: game.py, high_scores.py
- Clearance: 3
[4]
- File: high_scores.py
- Type: Python script
- Instructions: Implement the HighScores class to manage high scores and provide functions to add scores and get the highest score.
- Dependencies: None
- Clearance: 4
[Task list]
- game.py
- main.py
[Full API spec]
- OpenAPI 3.0 spec for API documentation (if applicable): None
[Shared Knowledge]
- game.py: Contains functions shared across the project.
[Anything UNCLEAR]
- None 2024-01-08 17:31:48.805 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.004 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1104, completion_tokens: 930 2024-01-08 17:31:48.812 | ERROR | metagpt.utils.common:log_it:438 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 293.840(s), this was the 5th time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [CONTENT] { "Implementation approach": "We will use Python's built-in turtle module to create the game board and implement the game logic. The game will be designed to be responsive using CSS media queries and mobile-first approach. High score tracking will be implemented using a simple dictionary.", "File list": ["main.py", "game.py", "ui.py", "high_scores.py"], "Data structures and interfaces": "\nclass Diagram\n class GameBoard\n - tiles: List[Tile]\n + create_board()\n + place_tile(position: str, value: int)\n + clear_board()\n \n class Tile\n - position: str\n - value: int\n - frozen: bool\n + update_value(new_value: int)\n \n class HighScores\n - scores: Dict[int, int]\n + add_score(score: int)\n + get_high_score()\n \n class UI\n - game_board: GameBoard\n - high_scores: HighScores\n + render_board(game_board: GameBoard)\n + render_high_scores(high_scores: HighScores)\n + show_menu()\n \n main -> UI: start_game()\n UI -> GameBoard: place_tile()\n UI -> GameBoard: clear_board()\n UI -> HighScores: add_score()\n UI -> HighScores: get_high_score()\n \n GameBoard -> Tile: update_value()\n HighScores -> UI: render_high_scores()\n ", "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant UI as UI\n participant GB as GameBoard\n participant HS as HighScores\n M->>UI: start_game\n UI->>GB: place_tile\n UI->>GB: clear_board\n UI->>HS: add_score\n UI->>HS: get_high_score\n GB->>Tile: update_value\n HS->>UI: render_high_scores\n ", "Anything UNCLEAR": "None" } [/CONTENT]
[Nodes] [1]
- File: main.py
- Type: Python script
- Instructions: Implement the main function, import the game, UI, and high_scores classes, and start the game.
- Dependencies: game.py, ui.py, high_scores.py
- Clearance: 1
[2]
- File: game.py
- Type: Python script
- Instructions: Contain the Game class and its functions, such as create_board, place_tile, clear_board, and update_value.
- Dependencies: None
- Clearance: 2
[3]
- File: ui.py
- Type: Python script
- Instructions: Implement the UI class with functions to render the game board, high scores, and show the menu.
- Dependencies: game.py, high_scores.py
- Clearance: 3
[4]
- File: high_scores.py
- Type: Python script
- Instructions: Implement the HighScores class to manage high scores and provide functions to add scores and get the highest score.
- Dependencies: None
- Clearance: 4
[Task list]
- game.py
- main.py
[Full API spec]
- OpenAPI 3.0 spec for API documentation (if applicable): None
[Shared Knowledge]
- game.py: Contains functions shared across the project.
[Anything UNCLEAR]
- None 2024-01-08 17:32:36.517 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.005 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1104, completion_tokens: 930 2024-01-08 17:32:36.523 | ERROR | metagpt.utils.common:log_it:438 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 341.551(s), this was the 6th time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error 2024-01-08 17:32:36.524 | WARNING | metagpt.utils.common:wrapper:510 - 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-08 17:32:36.534 | ERROR | metagpt.utils.common:wrapper:492 - Exception occurs, start to serialize the project, exp: Traceback (most recent call last): File "/Users/metagpt/opt/anaconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/Users/metagpt/software/ml/MetaGPT/metagpt/actions/action_node.py", line 280, in _aask_v1 instruct_content = output_class(**parsed_data) pydantic_core._pydantic_core.ValidationError: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Users/metagpt/software/ml/MetaGPT/metagpt/utils/common.py", line 501, in wrapper return await func(self, *args, **kwargs) File "/Users/metagpt/software/ml/MetaGPT/metagpt/roles/role.py", line 482, in run rsp = await self.react() tenacity.RetryError: RetryError[<Future at 0x7f9a91f521c0 state=finished raised ValidationError>]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/metagpt/software/ml/MetaGPT/metagpt/utils/common.py", line 487, in wrapper result = await func(self, *args, **kwargs) File "/Users/metagpt/software/ml/MetaGPT/metagpt/team.py", line 133, in run await self.env.run() Exception: Traceback (most recent call last): File "/Users/metagpt/opt/anaconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/Users/metagpt/software/ml/MetaGPT/metagpt/actions/action_node.py", line 280, in _aask_v1 instruct_content = output_class(**parsed_data) File "/Users/metagpt/opt/anaconda3/envs/metagpt/lib/python3.9/site-packages/pydantic/main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self) pydantic_core._pydantic_core.ValidationError: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Required Python packages', 'Shared Knowledge', 'Full API spec', 'Logic Analysis', 'Task list'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Users/metagpt/software/ml/MetaGPT/metagpt/utils/common.py", line 501, in wrapper return await func(self, *args, **kwargs) File "/Users/metagpt/software/ml/MetaGPT/metagpt/roles/role.py", line 482, in run rsp = await self.react() File "/Users/metagpt/software/ml/MetaGPT/metagpt/roles/role.py", line 450, in react rsp = await self._react() File "/Users/metagpt/software/ml/MetaGPT/metagpt/roles/role.py", line 429, in _react rsp = await self._act() # 这个rsp是否需要publish_message? File "/Users/metagpt/software/ml/MetaGPT/metagpt/roles/role.py", line 358, in _act response = await self.rc.todo.run(self.rc.history) File "/Users/metagpt/software/ml/MetaGPT/metagpt/actions/project_management.py", line 53, in run task_doc = await self._update_tasks( File "/Users/metagpt/software/ml/MetaGPT/metagpt/actions/project_management.py", line 79, in _update_tasks rsp = await self._run_new_tasks(context=system_design_doc.content) File "/Users/metagpt/software/ml/MetaGPT/metagpt/actions/project_management.py", line 91, in _run_new_tasks node = await PM_NODE.fill(context, self.llm, schema) File "/Users/metagpt/software/ml/MetaGPT/metagpt/actions/action_node.py", line 338, in fill return await self.simple_fill(schema=schema, mode=mode, timeout=timeout, exclude=exclude) File "/Users/metagpt/software/ml/MetaGPT/metagpt/actions/action_node.py", line 303, in simple_fill content, scontent = await self._aask_v1(prompt, class_name, mapping, schema=schema, timeout=timeout) File "/Users/metagpt/opt/anaconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) File "/Users/metagpt/opt/anaconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "/Users/metagpt/opt/anaconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x7f9a91f521c0 state=finished raised ValidationError>]
/Users/metagpt/opt/anaconda3/envs/metagpt/lib/python3.9/site-packages/pydantic/functional_serializers.py:272: UserWarning: Pydantic serializer warnings:
Expected str
but got dict
- serialized value may not be as expected
lambda x, h: h(x), schema=core_schema.any_schema()
/Users/metagpt/software/ml/MetaGPT/metagpt/schema.py:93: UserWarning: Pydantic serializer warnings:
Expected str
but got dict
- serialized value may not be as expected
ret = handler(value)
Excuse me, I have the same problem.the version 0.6.2 and master branch both used then they don't work. From above it seem to fix it,when I try it. By the way,I use the zhipu api to run it, not local llm model
@SuperbDong Do you set REPAIR_LLM_OUTPUT: true
in config/key.yaml
. If set but still have above problem, it's due to ZhiPuAPI can't follow the instruction to output the required_key. Maybe you can have a retry or use some else ideas.
I had set REPAIR_LLM_OUTPUT: true in config/key.yaml. Although I just to add log to debug output.
Has the question resolved? I met the same question, too. Sad!!!
I had set REPAIR_LLM_OUTPUT: true in config/key.yaml. Although I just to add log to debug output.
open and small size llms allways have poor instruction following ability to generate required structure. Currently, we have tried llama2-7b/13b and so on, it will works but not allways. Maybe you can try more times.
I had set REPAIR_LLM_OUTPUT: true in config/key.yaml. Although I just to add log to debug output.
Through debugging, I have identified the key to the problem, which can be caused by two reasons. 1.The Zhipu API cannot return the correct JSON format in too many cases.
example:
"标题": "MySQL教程",
"目录": [{
"目录1": [{
"标题1": "MySQL简介",
"内容1": "本章节将介绍MySQL的基本概念、特点和应用场景。"
},
{
"标题2": "安装与配置MySQL",
"内容2": "本章节将详细介绍如何在不同操作系统上安装和配置MySQL。"
},
{
"标题3": "MySQL数据库管理",
"内容3": ["MySQL命令行工具的使用", "MySQL Workbench的使用"]
}
],
{
"目录2": [{
"标题4": "MySQL表与数据",
"内容4": ["表的创建与删除", "数据的插入与查询"]
},
{
"标题5": "MySQL索引与查询优化",
"内容5": ["索引的概念与类型", "查询优化策略"]
},
{
"标题6": "MySQL存储与事务",
"内容6": ["存储引擎的工作原理", "事务的基本概念和操作"]
},
{
"标题7": "MySQL性能调优与日志",
"内容7": ["性能监控与分析", "日志的管理与使用"]
},
{
"标题8": "MySQL安全与权限",
"内容8": ["用户与权限管理", "加密与身份验证"]
}
]
}
]
}
2.Too Small LLM Model(<13b and so on) may be not identify the json is what.(json not corrent or markdown or text is shown)
example:
You are now a seasoned technical professional in the field of the internet.
We need you to write a technical tutorial with the topic "Write a tutorial about MySQL".
Please provide the specific table of contents for this tutorial, strictly following the following requirements:
1. The output must be strictly in the specified language, Chinese.
2. Answer strictly in the dictionary format like {"title": "xxx", "directory": [{"dir 1": ["sub dir 1", "sub dir 2"]}, {"dir 2": ["sub dir 3", "sub dir 4"]}]}.
3. The directory should be as specific and sufficient as possible, with a primary and secondary directory.The secondary directory is in the array.
4. Do not have extra spaces or line breaks.
5. Each directory title has practical significance.
INFO | metagpt.provider.base_llm:aask:49
# MySQL 教程
## 一、MySQL概述
### 1.1 MySQL简介
### 1.2 MySQL的发展历程
### 1.3 MySQL的应用场景
### 1.4 MySQL的优势
# MySQL 数据库
## 二、MySQL数据库
### 2.1 MySQL数据库结构
### 2.2 MySQL数据库表
### 2.3 MySQL数据库索引
### 2.4 MySQL数据库事务
### 2.5 MySQL数据库备份与恢复
# MySQL 数据操作
## 三、MySQL数据操作
### 3.1 MySQL数据表操作
### 3.2 MySQL数据查询
### 3.3 MySQL数据插入
### 3.4 MySQL数据更新
### 3.5 MySQL数据删除
### 3.6 MySQL数据统计
# MySQL 高级应用
## 四、MySQL高级应用
### 4.1 MySQL存储过程
### 4.2 MySQL触发器
### 4.3 MySQL视图
### 4.4 MySQL分表分库
### 4.5 MySQL安全策略
So, can we use spaces or other simple text formats instead of JSON in the future?
@better629 excuse me, i got the same problem when i use ChatGLM-Turbo model from ZHIPUAI_API, set REPAIR_LLM_OUTPUT: true to config.yaml not work,how can i do now?
2024-01-12 12:31:27.809 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.003 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1017, completion_tokens: 479 2024-01-12 12:31:27.811 | ERROR | metagpt.utils.common:log_it:438 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 142.401(s), this was the 6th time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Task list', 'Required Python packages', 'Full API spec', 'Required Other language third-party packages', 'Logic Analysis', 'Shared Knowledge'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error 2024-01-12 12:31:27.811 | WARNING | metagpt.utils.common:wrapper:510 - 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-12 12:31:27.811 | ERROR | metagpt.utils.common:wrapper:492 - Exception occurs, start to serialize the project, exp: Traceback (most recent call last): File "/home/newxie/.local/lib/python3.10/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/home/newxie/MetaGPT/metagpt/actions/action_node.py", line 280, in _aask_v1 instruct_content = output_class(**parsed_data) pydantic_core._pydantic_core.ValidationError: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Task list', 'Required Python packages', 'Full API spec', 'Required Other language third-party packages', 'Logic Analysis', 'Shared Knowledge'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/newxie/MetaGPT/metagpt/utils/common.py", line 501, in wrapper return await func(self, *args, **kwargs) File "/home/newxie/MetaGPT/metagpt/roles/role.py", line 485, in run rsp = await self.react() tenacity.RetryError: RetryError[<Future at 0x7f2fbd68e410 state=finished raised ValidationError>]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/newxie/MetaGPT/metagpt/utils/common.py", line 487, in wrapper result = await func(self, *args, **kwargs) File "/home/newxie/MetaGPT/metagpt/team.py", line 133, in run await self.env.run() Exception: Traceback (most recent call last): File "/home/newxie/.local/lib/python3.10/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/home/newxie/MetaGPT/metagpt/actions/action_node.py", line 280, in _aask_v1 instruct_content = output_class(**parsed_data) File "/home/newxie/.local/lib/python3.10/site-packages/pydantic/main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self) pydantic_core._pydantic_core.ValidationError: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Task list', 'Required Python packages', 'Full API spec', 'Required Other language third-party packages', 'Logic Analysis', 'Shared Knowledge'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/newxie/MetaGPT/metagpt/utils/common.py", line 501, in wrapper return await func(self, *args, **kwargs) File "/home/newxie/MetaGPT/metagpt/roles/role.py", line 485, in run rsp = await self.react() File "/home/newxie/MetaGPT/metagpt/roles/role.py", line 453, in react rsp = await self._react() File "/home/newxie/MetaGPT/metagpt/roles/role.py", line 432, in _react rsp = await self._act() # 这个rsp是否需要publish_message? File "/home/newxie/MetaGPT/metagpt/roles/role.py", line 361, in _act response = await self.rc.todo.run(self.rc.history) File "/home/newxie/MetaGPT/metagpt/actions/project_management.py", line 53, in run task_doc = await self._update_tasks( File "/home/newxie/MetaGPT/metagpt/actions/project_management.py", line 79, in _update_tasks rsp = await self._run_new_tasks(context=system_design_doc.content) File "/home/newxie/MetaGPT/metagpt/actions/project_management.py", line 91, in _run_new_tasks node = await PM_NODE.fill(context, self.llm, schema) File "/home/newxie/MetaGPT/metagpt/actions/action_node.py", line 338, in fill return await self.simple_fill(schema=schema, mode=mode, timeout=timeout, exclude=exclude) File "/home/newxie/MetaGPT/metagpt/actions/action_node.py", line 303, in simple_fill content, scontent = await self._aask_v1(prompt, class_name, mapping, schema=schema, timeout=timeout) File "/home/newxie/.local/lib/python3.10/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) File "/home/newxie/.local/lib/python3.10/site-packages/tenacity/_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "/home/newxie/.local/lib/python3.10/site-packages/tenacity/init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x7f2fbd68e410 state=finished raised ValidationError>]
/home/newxie/.local/lib/python3.10/site-packages/pydantic/functional_serializers.py:272: UserWarning: Pydantic serializer warnings:
Expected str
but got dict
- serialized value may not be as expected
lambda x, h: h(x), schema=core_schema.any_schema()
/home/newxie/MetaGPT/metagpt/schema.py:93: UserWarning: Pydantic serializer warnings:
Expected str
but got dict
- serialized value may not be as expected
ret = handler(value)
@xjc01288 If you have set REPAIR_LLM_OUTPUT: true
and run failed. Maybe you can re-run metagpt {your_idea}
multi-times.
And the detail log is in the logs
folder, above message only show that the output can't follow the instruction output, but not detail.
@SuperbDong Due to its' a multi-agent / multi-action pipeline, we need the parsed structure from the llm output to go on the process. Maybe you can define the custom parser to deal the output, but it will cost time.
keep getting this issue, guys anything would be helpful? 有没有大佬给看看 谢谢
2023-12-14 23:17:23.956 | WARNING | metagpt.utils.repair_llm_raw_output:run_and_passon:231 - parse json from content inside [CONTENT][/CONTENT] failed at retry 1, try to fix it, exp: Expecting ',' delimiter: line 74 column 5 (char 2911) 2023-12-14 23:17:23.957 | INFO | metagpt.utils.repair_llm_raw_output:repair_invalid_json:202 - repair_invalid_json, raw error: Expecting ',' delimiter: line 74 column 5 (char 2911) 2023-12-14 23:17:23.957 | ERROR | metagpt.utils.utils:log_it:16 - Finished call to 'metagpt.actions.action.Action._aask_v1' after 52.073(s), this was the 1st time calling it. exp: RetryError[<Future at 0x1371c6220 state=finished raised JSONDecodeError>] /CONTENT] [CONTENT]
一般是OPENAI_BASE_URL设置不对,如果是中转地址需要注意
2024-05-27 23:18:58.554 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to /home/cpz/BadAent/MetaGPT Here is the plan to achieve the goal:
[
{
"task_id": "1",
"dependent_task_ids": [],
"instruction": "Extract article URLs from the given collection"
},
{
"task_id": "2",
"dependent_task_ids": ["1"],
"instruction": "Record each article and remove duplicates by title"
},
{
"task_id": "3",
"dependent_task_ids": ["2"],
"instruction": "Filter out papers related to large language model/agent/LLM"
},
{
"task_id": "4",
"dependent_task_ids": ["3"],
"instruction": "Print top 100 articles and visualize the word count of the titles"
}
]
2024-05-27 23:19:38.923 | INFO | metagpt.utils.cost_manager:update_cost:103 - prompt_tokens: 362, completion_tokens: 159
2024-05-27 23:19:38.925 | ERROR | metagpt.utils.common:parse_code:281 - .*?\s+(.*?)
not match following text:
2024-05-27 23:19:38.925 | ERROR | metagpt.utils.common:parse_code:282 - Here is the plan to achieve the goal:
[ { "task_id": "1", "dependent_task_ids": [], "instruction": "Extract article URLs from the given collection" }, { "task_id": "2", "dependent_task_ids": ["1"], "instruction": "Record each article and remove duplicates by title" }, { "task_id": "3", "dependent_task_ids": ["2"], "instruction": "Filter out papers related to large language model/agent/LLM" }, { "task_id": "4", "dependent_task_ids": ["3"], "instruction": "Print top 100 articles and visualize the word count of the titles" } ] 2024-05-27 23:19:38.926 | WARNING | metagpt.strategy.planner:update_plan:63 - The generated plan is not valid with error: Expecting value: line 1 column 1 (char 0), try regenerating, remember to generate either the whole plan or the single changed task only Here is the plan to achieve the goal:
[
{
"task_id": "1",
"dependent_task_ids": [],
"instruction": "Extract article URLs from the given collection"
},
{
"task_id": "2",
"dependent_task_ids": ["1"],
"instruction": "Record each article and remove duplicates by title using a dictionary or set data structure"
},
{
"task_id": "3",
"dependent_task_ids": ["2"],
"instruction": "Filter out papers related to large language model/agent/LLM by searching for keywords in the titles"
},
{
"task_id": "4",
"dependent_task_ids": ["3"],
"instruction": "Print top 100 articles and visualize the word count of the titles using a bar chart or histogram"
}
]
2024-05-27 23:19:54.277 | INFO | metagpt.utils.cost_manager:update_cost:103 - prompt_tokens: 404, completion_tokens: 179
2024-05-27 23:19:54.278 | ERROR | metagpt.utils.common:parse_code:281 - .*?\s+(.*?)
not match following text:
2024-05-27 23:19:54.278 | ERROR | metagpt.utils.common:parse_code:282 - Here is the plan to achieve the goal:
[ { "task_id": "1", "dependent_task_ids": [], "instruction": "Extract article URLs from the given collection" }, { "task_id": "2", "dependent_task_ids": ["1"], "instruction": "Record each article and remove duplicates by title using a dictionary or set data structure" }, { "task_id": "3", "dependent_task_ids": ["2"], "instruction": "Filter out papers related to large language model/agent/LLM by searching for keywords in the titles" }, { "task_id": "4", "dependent_task_ids": ["3"], "instruction": "Print top 100 articles and visualize the word count of the titles using a bar chart or histogram" } ] 2024-05-27 23:19:54.278 | WARNING | metagpt.strategy.planner:update_plan:63 - The generated plan is not valid with error: Expecting value: line 1 column 1 (char 0), try regenerating, remember to generate either the whole plan or the single changed task only Here is the plan to achieve the goal:
[
{
"task_id": "1",
"dependent_task_ids": [],
"instruction": "Extract article URLs from the given collection"
},
{
"task_id": "2",
"dependent_task_ids": ["1"],
"instruction": "Record each article and remove duplicates by title using a dictionary or set data structure"
},
{
"task_id": "3",
"dependent_task_ids": ["2"],
"instruction": "Filter out papers related to large language model/agent/LLM by searching for keywords in the titles"
},
{
"task_id": "4",
"dependent_task_ids": ["3"],
"instruction": "Print top 100 articles and visualize the word count of the titles using a bar chart or histogram"
}
]
2024-05-27 23:20:09.590 | INFO | metagpt.utils.cost_manager:update_cost:103 - prompt_tokens: 422, completion_tokens: 179
2024-05-27 23:20:09.590 | ERROR | metagpt.utils.common:parse_code:281 - .*?\s+(.*?)
not match following text:
2024-05-27 23:20:09.591 | ERROR | metagpt.utils.common:parse_code:282 - Here is the plan to achieve the goal:
[ { "task_id": "1", "dependent_task_ids": [], "instruction": "Extract article URLs from the given collection" }, { "task_id": "2", "dependent_task_ids": ["1"], "instruction": "Record each article and remove duplicates by title using a dictionary or set data structure" }, { "task_id": "3", "dependent_task_ids": ["2"], "instruction": "Filter out papers related to large language model/agent/LLM by searching for keywords in the titles" }, { "task_id": "4", "dependent_task_ids": ["3"], "instruction": "Print top 100 articles and visualize the word count of the titles using a bar chart or histogram" } ] 2024-05-27 23:20:09.591 | WARNING | metagpt.strategy.planner:update_plan:63 - The generated plan is not valid with error: Expecting value: line 1 column 1 (char 0), try regenerating, remember to generate either the whole plan or the single changed task only Here is the plan to achieve the goal:
[
{
"task_id": "1",
"dependent_task_ids": [],
"instruction": "Extract article URLs from the given collection"
},
{
"task_id": "2",
"dependent_task_ids": ["1"],
"instruction": "Record each article and remove duplicates by title using a dictionary or set data structure"
},
{
"task_id": "3",
"dependent_task_ids": ["2"],
"instruction": "Filter out papers related to large language model/agent/LLM by searching for keywords in the titles"
},
{
"task_id": "4",
"dependent_task_ids": ["3"],
"instruction": "Print top 100 articles and visualize the word count of the titles using a bar chart or histogram"
}
]
2024-05-27 23:20:25.481 | INFO | metagpt.utils.cost_manager:update_cost:103 - prompt_tokens: 422, completion_tokens: 179
2024-05-27 23:20:25.481 | ERROR | metagpt.utils.common:parse_code:281 - .*?\s+(.*?)
not match following text:
2024-05-27 23:20:25.481 | ERROR | metagpt.utils.common:parse_code:282 - Here is the plan to achieve the goal:
[ { "task_id": "1", "dependent_task_ids": [], "instruction": "Extract article URLs from the given collection" }, { "task_id": "2", "dependent_task_ids": ["1"], "instruction": "Record each article and remove duplicates by title using a dictionary or set data structure" }, { "task_id": "3", "dependent_task_ids": ["2"], "instruction": "Filter out papers related to large language model/agent/LLM by searching for keywords in the titles" }, { "task_id": "4", "dependent_task_ids": ["3"], "instruction": "Print top 100 articles and visualize the word count of the titles using a bar chart or histogram" } ] 2024-05-27 23:20:25.482 | WARNING | metagpt.utils.common:wrapper:572 - There is a exception in role's execution, in order to resume, we delete the newest role communication message in the role's memory. Traceback (most recent call last): File "/home/cpz/anaconda3/lib/python3.11/site-packages/metagpt/utils/common.py", line 563, in wrapper return await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cpz/anaconda3/lib/python3.11/site-packages/metagpt/roles/role.py", line 558, in run rsp = await self.react() ^^^^^^^^^^^^^^^^^^ File "/home/cpz/anaconda3/lib/python3.11/site-packages/metagpt/roles/role.py", line 529, in react rsp = await self._plan_and_act() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cpz/anaconda3/lib/python3.11/site-packages/metagpt/roles/role.py", line 489, in _plan_and_act await self.planner.update_plan(goal=goal) File "/home/cpz/anaconda3/lib/python3.11/site-packages/metagpt/strategy/planner.py", line 70, in update_plan update_plan_from_rsp(rsp=rsp, current_plan=self.plan) File "/home/cpz/anaconda3/lib/python3.11/site-packages/metagpt/actions/di/write_plan.py", line 89, in update_plan_from_rsp tasks = rsp_to_tasks(rsp) ^^^^^^^^^^^^^^^^^ File "/home/cpz/anaconda3/lib/python3.11/site-packages/metagpt/actions/di/write_plan.py", line 83, in rsp_to_tasks rsp = json.loads(rsp) ^^^^^^^^^^^^^^^ File "/home/cpz/anaconda3/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cpz/anaconda3/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cpz/anaconda3/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/cpz/BadAent/MetaGPT/./examples/di/arxiv_reader.py", line 21, in
I used llama3-70b, and obtained this result from arixv.py, how do I solve it?
@Zhou-CyberSecurity-AI DI hasn't support json-repair ability so some open source llms may failed due to json format problem, maybe you can the deepseek-coder or openai / claude to have a try.