output_schema to LlmAgent.
event.data when it’s the final response:
How it works
PydanticOutputParser.get_format_instructions()is appended to the system prompt- When the LLM responds,
PydanticOutputParser.parse()extracts and validates JSON - If direct parsing fails,
with_structured_output()is used as a fallback - Works with streaming and multi-agent compositions