Structured outputs
⚠️
Preview — this feature is being built; the design below is the spec.
Structured outputs make the model’s reply machine-readable. Syntic offers two mechanisms, and this section goes deeper on using them well.
| Mechanism | Field | What it constrains | Reference |
|---|---|---|---|
| JSON output | response_format | The assistant’s reply text | JSON output |
| Strict tools | tools[].function.strict | Arguments the model passes to your functions | Strict tool arguments |
Which one to use
- The reply is the data (classification, extraction, scoring): use
response_formatwithjson_schema. - The model should decide whether to act and with what values (search, book, refund): use tools, and make them strict.
- You need both reasoning shown to a person and data for your code: let the model write normally and call a strict
record_resulttool at the end.
Pages in this section
| Page | Covers |
|---|---|
| Design schemas | Enums, nullable fields, arrays, descriptions that steer the model. |
| SDK helpers | Defining schemas as Pydantic models or Zod objects and getting typed results back. |
| Stream structured output | Showing partial JSON as it arrives. |
| Refusals and cut-offs | What happens when the model declines or runs out of tokens. |
| JSON mode or schema? | When the looser json_object mode is enough. |
Was this page helpful?