#[non_exhaustive]pub struct ModelOutput {
pub response: ModelResponse,
pub usage: Option<ModelUsage>,
pub stop_reason: ModelStopReason,
pub raw_stop_reason: Option<String>,
pub reasoning: Option<ReasoningPayload>,
}Expand description
The gateway result envelope. Pure response conversion consumes neither this value nor its usage and reasoning; execution consumers retain them.
Serializable for logs and tests; the serialized form is not part of the stable set and may change in any release.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.response: ModelResponseWhat the model said and asked: the ModelResponse fact.
usage: Option<ModelUsage>Token accounting, when the provider disclosed it.
stop_reason: ModelStopReasonWhy generation ended: the ModelStopReason fact.
raw_stop_reason: Option<String>The stop value exactly as the upstream provider or model sent it,
so a host can inspect what an unrecognized stop condition was. None
only for gateways with no wire value, such as test doubles.
reasoning: Option<ReasoningPayload>Structured reasoning payload, when the provider emitted one.
Implementations§
Source§impl ModelOutput
impl ModelOutput
Sourcepub fn new(response: ModelResponse, stop_reason: ModelStopReason) -> Self
pub fn new(response: ModelResponse, stop_reason: ModelStopReason) -> Self
An output with its response and stop reason; usage, the raw stop value and reasoning start absent.