Quick Start
1
Simple Usage
Define a Pydantic model and pass it to
output_pydantic:2
Multi-Agent Task
Use
Task with output_pydantic inside an AgentTeam:How It Works
Native Structured Output
PraisonAI auto-detects models that support nativeresponse_format with JSON schema (GPT-4o, Claude 3.5, Gemini 2.0). Unsupported models fall back to prompt injection.
YAML Configuration
praisonai agents.yaml.
Best Practices
Keep models small and explicit
Keep models small and explicit
Define only the fields you need. Smaller schemas validate faster and reduce model confusion.
Prefer output_pydantic for Python apps
Prefer output_pydantic for Python apps
Use
output_pydantic when you want a typed object; use output_json when you only need serialisable dicts.Let native mode auto-detect
Let native mode auto-detect
Leave
native_structured_output unset unless you know your model needs forcing — the SDK picks the cleanest path.Validate failures in verbose mode
Validate failures in verbose mode
Enable verbose output while tuning schemas so validation errors show which field failed.
Related
Structured LLM Errors
Handle validation and LLM failures gracefully
Output & Display
Format and present agent responses
Agent Teams
Multi-agent workflows with structured tasks
Tasks
Task configuration and output options

