pub struct DrainedStream {
pub items: Vec<Result<Item<StreamEvent>, ErrorReport>>,
pub choice: Vec<AssistantContent>,
pub response: Option<CompletionResponse>,
}Available on crate feature
test-utils and not (target_os=unknown and WebAssembly) only.Expand description
Everything the consumer observed from one full pipeline run: the yielded items in order, plus the response they folded into.
Fields§
§items: Vec<Result<Item<StreamEvent>, ErrorReport>>Every item the stream yielded, in order.
choice: Vec<AssistantContent>The parts that ended, in position: the response’s choice, or what arrived before the stream stopped.
response: Option<CompletionResponse>The response, absent on truncation or a terminal error.
Implementations§
Source§impl DrainedStream
impl DrainedStream
Sourcepub fn tool_call_names(&self) -> Vec<&str>
pub fn tool_call_names(&self) -> Vec<&str>
Names of the tool calls that ended on the stream, in order.
Sourcepub fn unknown_values(&self) -> Vec<&Value>
pub fn unknown_values(&self) -> Vec<&Value>
Raw payloads of the Unknown items the stream yielded, in order.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Number of Err items the stream yielded.
Sourcepub fn choice_texts(&self) -> Vec<&str>
pub fn choice_texts(&self) -> Vec<&str>
Text parts in the aggregated choice, in order.
Sourcepub fn choice_reasoning(&self) -> Vec<&Reasoning>
pub fn choice_reasoning(&self) -> Vec<&Reasoning>
Reasoning parts in the aggregated choice, in order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DrainedStream
impl RefUnwindSafe for DrainedStream
impl Send for DrainedStream
impl Sync for DrainedStream
impl Unpin for DrainedStream
impl UnsafeUnpin for DrainedStream
impl UnwindSafe for DrainedStream
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more