Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Structured Outputs and Schema Validation

Structured output defines fields and value types for a model response. Use it when another step needs to read specific values instead of interpreting free-form prose.

Inspect a response schema, run the workflow, and check the returned fields and values.

Before you begin

A model and node that support the required output format.

Output formats and validation

Term
Definition

Structured output

A response arranged into defined fields rather than free-form prose. Check both the field structure and the meaning of its values.

Schema

A definition of fields, types, required values, and supported constraints. Use it to validate the shape of data; it does not establish factual correctness.

Null

An explicit JSON value indicating no value. It can differ from an omitted field, an empty string, or an empty collection.

Configuration options

Option
Purpose
Behavior

JSON Object

A JSON-formatted response mode where supported by the selected model.

Valid JSON alone does not impose every field or type required by your application.

JSON Schema

A schema used to specify the supported structure and constraints of an object.

Use schema validation in addition to reviewing factual accuracy.

Configure structured output

  1. Select the structured output format and define the required fields.

  2. Describe the meaning of each field in the instructions.

  3. Run the node and inspect both schema validity and the accuracy of the values.

Response format options controls in StackAI
Use Text for a free-form response. JSON Object requests a JSON object without specifying all of its fields. JSON Schema defines the required structure, field types, and constraints. A structurally valid response can still contain incorrect facts; validate the content before using it in a consequential action.

The next step can read the expected fields from the generated object.

Behavior and limitations

Valid JSON is not necessarily valid against your schema. Schema-valid data is not necessarily factually correct. Handle missing evidence explicitly rather than forcing the model to invent required values. A display template formats values; it does not replace validation of the underlying response.

Model Settings and Supported Capabilities

Last updated

Was this helpful?