Even with schema-constrained generation, always validate output on your server.Documentation Index
Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt
Use this file to discover all available pages before exploring further.
Recommended loop
- Request schema-constrained output.
- Parse JSON.
- Validate against your server schema.
- Retry once with a corrective prompt if invalid.
- Fallback to safe failure if still invalid.
Validation example (TypeScript)
Corrective retry prompt
When validation fails, send a short corrective instruction:Your previous output did not match schema. Return valid JSON only, with required fields and no extra keys.
Production guidance
- Keep one schema per use case and version it.
- Track validation failure rates by model id.
- Alert on sudden schema failure spikes after model changes.