input_schema to validate dictionaries automatically.
Input Format Types
Using Pydantic Models
Pass a Pydantic model instance toinput:
ValidationError before the agent runs.
Using input_schema
Set input_schema on the agent to validate dictionaries automatically:
Handling Invalid Input
Invalid dictionary input raises aValueError wrapping the Pydantic error:
Common Patterns
API Request Handler
Configuration-Driven Tasks
Nested Models
Related
- Team Structured Input: Configure structured input for teams
- Structured Output: Get validated output from agents