MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Errors for PRD when using gpt-3.5 api please help

Open HarshShah0203 opened this issue 1 year ago • 6 comments

I am constantly trying to make it work but keeps on getting error like this type File "pydantic\main.py", line 341, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 5 validation errors for prd Requirement Pool -> 0 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 1 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 2 value is not a valid tuple (type=type_error.tuple) Requi…

HarshShah0203 avatar Aug 24 '23 18:08 HarshShah0203

Make sure you the python version is 3.9.x and install the exactly version of dependencies in requirements.txt

voidking avatar Aug 30 '23 12:08 voidking

I got the same error. 2023-08-31 14:39:24.792 | INFO | metagpt.provider.openai_api:update_cost:81 - Total running cost: $0.012 | Max budget: $3.000 | Current cost: $0.005, prompt_tokens: 844, completion_tokens: 727 Traceback (most recent call last): File "D:\Anaconda3\envs\Agent\lib\site-packages\tenacity_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "D:\share\MetaGPT\metagpt\metagpt\actions\action.py", line 62, in _aask_v1 instruct_content = output_class(**parsed_data) File "pydantic\main.py", line 341, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 5 validation errors for prd Requirement Pool -> 0 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 1 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 2 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 3 value is not a valid tuple (type=type_error.tuple) Anything UNCLEAR field required (type=value_error.missing)

yueyin19960520 avatar Aug 31 '23 06:08 yueyin19960520

same here: 2023-09-08 22:18:19.308 | INFO | metagpt.provider.openai_api:update_cost:79 - Total running cost: $0.013 | Max budget: $3.000 | Current cost: $0.007, prompt_tokens: 914, completion_tokens: 963 Traceback (most recent call last): File "C:\Python311\Lib\site-packages\tenacity-8.2.2-py3.11.egg\tenacity_asyncio.py", line 50, in call result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Development\workspace\metagpt\metagpt\metagpt\actions\action.py", line 62, in _aask_v1 instruct_content = output_class(**parsed_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\pydantic-1.10.8-py3.11.egg\pydantic\main.py", line 341, in init raise validation_error pydantic.error_wrappers.ValidationError: 6 validation errors for prd Requirement Pool -> 0 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 1 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 2 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 3 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 4 value is not a valid tuple (type=type_error.tuple) Anything UNCLEAR field required (type=value_error.missing)

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

Traceback (most recent call last): File "D:\Development\workspace\metagpt\metagpt\startup.py", line 68, in fire.Fire(main) File "C:\Python311\Lib\site-packages\fire-0.4.0-py3.11.egg\fire\core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\fire-0.4.0-py3.11.egg\fire\core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( ^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\fire-0.4.0-py3.11.egg\fire\core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^ File "D:\Development\workspace\metagpt\metagpt\startup.py", line 63, in main asyncio.run(startup(idea, investment, n_round, File "C:\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "D:\Development\workspace\metagpt\metagpt\startup.py", line 40, in startup await company.run(n_round=n_round) File "D:\Development\workspace\metagpt\metagpt\metagpt\software_company.py", line 60, in run await self.environment.run() File "D:\Development\workspace\metagpt\metagpt\metagpt\environment.py", line 67, in run await asyncio.gather(*futures) File "D:\Development\workspace\metagpt\metagpt\metagpt\roles\role.py", line 240, in run rsp = await self._react() ^^^^^^^^^^^^^^^^^^^ File "D:\Development\workspace\metagpt\metagpt\metagpt\roles\role.py", line 209, in _react return await self._act() ^^^^^^^^^^^^^^^^^ File "D:\Development\workspace\metagpt\metagpt\metagpt\roles\role.py", line 168, in _act response = await self._rc.todo.run(self._rc.important_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Development\workspace\metagpt\metagpt\metagpt\actions\write_prd.py", line 145, in run prd = await self.aask_v1(prompt, "prd", OUTPUT_MAPPING) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\tenacity-8.2.2-py3.11.egg\tenacity_asyncio.py", line 88, in async_wrapped return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\tenacity-8.2.2-py3.11.egg\tenacity_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\tenacity-8.2.2-py3.11.egg\tenacity_init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x1c57c6f2dd0 state=finished raised ValidationError>]

vbalko avatar Sep 08 '23 20:09 vbalko

I am having the same issue while running the docker container.

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/app/metagpt/metagpt/actions/action.py", line 62, in _aask_v1 instruct_content = output_class(**parsed_data) File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 5 validation errors for prd Requirement Pool -> 0 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 1 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 2 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 3 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 4 value is not a valid tuple (type=type_error.tuple)

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

itlackey avatar Sep 19 '23 06:09 itlackey

@better629 pls guide, got the same error

(metagpt1) maryam_linux@Maryam:/mnt/c/Users/Hp/Downloads/metagptv1/MetaGPT-0.1.0$ python startup.py "write a cli snake game" --investment=10 2024-01-09 07:48:46.594 | INFO | metagpt.config:init:43 - Config loading done. 2024-01-09 07:48:47.316 | INFO | metagpt.software_company:invest:39 - Investment: $10. 2024-01-09 07:48:47.318 | INFO | metagpt.roles.role:_act:155 - Alice(Product Manager): ready to WritePRD 2024-01-09 07:48:47.318 | WARNING | metagpt.actions.search_and_summarize:run:114 - Configure SERPAPI_API_KEY to unlock full feature

2024-01-09 07:48:47.683 | INFO | metagpt.provider.openai_api:update_cost:89 - Total running cost: $0.048 | Max budget: $10.000 | Current cost: $0.048, prompt_tokens=798, completion_tokens=0

2024-01-09 07:48:48.790 | INFO | metagpt.provider.openai_api:update_cost:89 - Total running cost: $0.096 | Max budget: $10.000 | Current cost: $0.048, prompt_tokens=798, completion_tokens=0 Traceback (most recent call last): File "/home/maryam_linux/miniconda3/envs/metagpt1/lib/python3.11/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Hp/Downloads/metagptv1/MetaGPT-0.1.0/metagpt/actions/action.py", line 60, in _aask_v1 instruct_content = output_class(**parsed_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 8 validation errors for prd Original Requirements field required (type=value_error.missing) Product Goals field required (type=value_error.missing) User Stories field required (type=value_error.missing) Competitive Analysis field required (type=value_error.missing) Competitive Quadrant Chart field required (type=value_error.missing) Requirement Analysis field required (type=value_error.missing) Requirement Pool field required (type=value_error.missing) Anything UNCLEAR field required (type=value_error.missing)

MARYAMJAHANIR avatar Jan 09 '24 02:01 MARYAMJAHANIR

@MARYAMJAHANIR we have make a big version update, can you try the latest one from pypi or the repo's tag. The reason above is usually the llm can't follow the instruction to generate required keys/values, maybe you can have a re-run. If there still has problem, you can upload the log, it's more detail.

better629 avatar Jan 09 '24 08:01 better629