Skip to main content

Module output

Module output 

Source
Expand description

Structured output strategies for generate_text and stream_text.

An Output decides the response format sent to the model and parses the final (and, when streaming, partial) text.

Structs§

ArrayOutput
An array of schema-validated elements, wrapped in { "elements": [...] } on the wire.
ChoiceOutput
One of a fixed set of string options.
JsonOutput
Unconstrained (or raw-schema-validated) JSON.
NoOutput
The strategy used when no output is requested: no response format, no parsing.
ObjectOutput
A JSON object validated by a schema.
Output
A structured output specification producing values of type T.
OutputContext
Response context handed to OutputHandler::parse_complete (used to populate NoObjectGenerated errors).
PartialOutput
A partial structured output published while streaming.
TextOutput
Plain text.

Traits§

ArrayElements
Marker for outputs that stream element by element (Vec<T>).
OutputHandler
Implements an output strategy for output type O.