#[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.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
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.
Trait Implementations§
Source§impl Clone for ModelOutput
impl Clone for ModelOutput
Source§impl Debug for ModelOutput
impl Debug for ModelOutput
Source§impl<'de> Deserialize<'de> for ModelOutput
impl<'de> Deserialize<'de> for ModelOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelOutput
impl RefUnwindSafe for ModelOutput
impl Send for ModelOutput
impl Sync for ModelOutput
impl Unpin for ModelOutput
impl UnsafeUnpin for ModelOutput
impl UnwindSafe for ModelOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more