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§
- Array
Output - An array of schema-validated elements, wrapped in
{ "elements": [...] }on the wire. - Choice
Output - One of a fixed set of string options.
- Json
Output - Unconstrained (or raw-schema-validated) JSON.
- NoOutput
- The strategy used when no output is requested: no response format, no parsing.
- Object
Output - A JSON object validated by a schema.
- Output
- A structured output specification producing values of type
T. - Output
Context - Response context handed to
OutputHandler::parse_complete(used to populateNoObjectGeneratederrors). - Partial
Output - A partial structured output published while streaming.
- Text
Output - Plain text.
Traits§
- Array
Elements - Marker for outputs that stream element by element (
Vec<T>). - Output
Handler - Implements an output strategy for output type
O.