All questions
How can I force structured outputs like JSON or CSV?
Give a strict schema, forbid extra text, and include one valid example. Ask the model to validate against the schema before returning. Parse on your side and auto-retry with a correction hint if parsing fails. Keep field names and types simple.
In practice
Schema comments (brief field notes) improve accuracy more than long narratives.
Where to start
- 1Define your schema with required/optional fields.
- 2Provide a minimal working example.
- 3Add a parser + retry loop.
- 4Track field-level error rates over time.
JSON output promptstructured output AILLM CSV