Hello guys,
I’m encountering a validation issue while using Pydantic to parse a response in my Phidata AI Agent project. The error indicates that certain fields in my nested dictionary are not recognized as valid strings, even though they appear correctly structured. Below is the error traceback:
(.env) abc@7bf4c6efcc6f:~/deneme/autowp$ python autowp2.py
WARNING Failed to convert response to pydantic model: 4 validation errors for ReasoningSteps
reasoning_steps.0.reasoning
Input should be a valid string [type=string_type, input_value={'necessity': "This infor...at the specified date.'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/string_type
reasoning_steps.1.reasoning
Input should be a valid string [type=string_type, input_value={'necessity': "Providing ...cryptocurrency market."}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/string_type
reasoning_steps.2.reasoning
Input should be a valid string [type=string_type, input_value={'necessity': 'Summarizin...hlight the key points.'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/string_type
reasoning_steps.3.reasoning
Input should be a valid string [type=string_type, input_value={'necessity': "Validation...ation for the summary.'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/string_type
WARNING Failed to convert response to response_model
ERROR Reasoning error: 'str' object has no attribute 'reasoning_steps'
^CTraceback (most recent call last):
File "/config/deneme/autowp/autowp2.py", line 209, in <module>
I only get this error when I enable reasoning. Is there a way to use reasoning and structured output at the same time? I would be very happy if you could help me, thank you.