Question
When I set the output type of an agent to a TypedDict, sometimes the AI returns incorrect JSON (see attached screenshot).
I’d like to know if there’s a way to preprocess or adjust the agent’s response after the AI generates it but before it’s passed to the final_result tool.
- Does output_validator handle this kind of preprocessing?
- Or do I need to use stream_responses and validate_response_output manually to intercept and fix responses?
Additional Context
No response