output · TicketTriage
{
"category": "billing",
"priority": "high",
"order_id": "48213",
"needs_human": true
}
- ✓ valid JSON
- ✓ schema v3
- ✓ enum values
- retries: 0 / 2
FundamentalsGuide8 min read
Reliable Structured Outputs with JSON Schema and Validation
When an LLM's output feeds other code, treat it like any untrusted input: define a schema, validate strictly, retry with specific feedback, and fail loudly when the model can't comply.
By Alex Morgan · sample author