Schema
A schema is an explicit description of the fields, types, and structure that a model’s output must conform to.
Including the schema in the prompt — rather than describing the fields in prose — measurably improves conformance. Placing it before the source material also helps, because the model reads the target shape before the content it must fit into that shape.
Related terms
- Structured output
- Structured output is model output constrained to a machine-readable shape such as JSON, CSV, or a fixed schema, rather than free prose.
- JSON mode
- JSON mode is a model setting that constrains generation so the response is always syntactically valid JSON.
More on prompt structure
See the full glossary, read the guides, or put it into practice in the prompt builder.