pub struct AggLlmResponse {
pub id: Option<String>,
pub model: Option<String>,
pub outputs: Vec<ResponseOutput>,
pub usage: Usage,
pub extensions: ProviderExtensions,
pub preservation: PreservationMetadata,
}Expand description
Normalized, fully-buffered response — the aggregate of a completed generation.
This is the terminal form of a streamed LlmResponse.
Fields§
§id: Option<String>Provider response identifier.
model: Option<String>Model reported by the provider.
outputs: Vec<ResponseOutput>Ordered response output items.
usage: UsageNormalized token usage.
extensions: ProviderExtensionsProvider response fields without normalized equivalents.
preservation: PreservationMetadataExact provider bodies retained for lossless round trips.
Implementations§
Source§impl AggLlmResponse
impl AggLlmResponse
Sourcepub fn first_output(&self) -> Option<&ResponseOutput>
pub fn first_output(&self) -> Option<&ResponseOutput>
Returns the first output item when a response has any output.
Source§impl AggLlmResponse
impl AggLlmResponse
Sourcepub fn into_stream(self) -> LlmResponseStream
pub fn into_stream(self) -> LlmResponseStream
Converts a fully-buffered response into a synthetic chunk stream.
Useful when a caller had to buffer the response (e.g. to judge it) but the
downstream expects LlmResponse::Stream — for instance when stream: true was
requested and the algorithm had to aggregate before it could return.
This conversion is lossy: only text, reasoning, and tool-call content has a synthetic chunk representation. Refusals, tool results, media, files, MCP activity, unknown blocks, response extensions, and preservation metadata are omitted.
Trait Implementations§
Source§impl Clone for AggLlmResponse
impl Clone for AggLlmResponse
Source§fn clone(&self) -> AggLlmResponse
fn clone(&self) -> AggLlmResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more