StructuredOutputAgent
An agent that guarantees its output matches a Pydantic schema — with automatic validation and self-repair on failure.
Import path: agentflow.prebuilt.agent
Concept
Standard LLMs sometimes produce malformed JSON or output that does not conform to your schema. StructuredOutputAgent adds a validation-and-repair loop: if the output fails validation, it injects a correction message that includes the exact error and the full JSON Schema, then tries again.