pub struct DrainedStream {
pub items: Vec<Result<StreamedAssistantContent, CompletionError>>,
pub choice: Vec<AssistantContent>,
pub response: Option<StreamFinal>,
}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 aggregated choice and terminal record.
Fields§
§items: Vec<Result<StreamedAssistantContent, CompletionError>>Every item the stream yielded, in order.
choice: Vec<AssistantContent>The final aggregated assistant message.
response: Option<StreamFinal>The normalized terminal record, absent on truncation or 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 complete tool calls yielded to the consumer, in order.
Sourcepub fn unknown_values(&self) -> Vec<&Value>
pub fn unknown_values(&self) -> Vec<&Value>
Raw payloads of the Unknown passthrough 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 final_count(&self) -> usize
pub fn final_count(&self) -> usize
Number of terminal records the stream yielded.
Sourcepub fn choice_texts(&self) -> Vec<&str>
pub fn choice_texts(&self) -> Vec<&str>
Text blocks in the aggregated choice, in order.
Sourcepub fn choice_reasoning(&self) -> Vec<&Reasoning>
pub fn choice_reasoning(&self) -> Vec<&Reasoning>
Reasoning items in the aggregated choice, in order.
Sourcepub fn choice_tool_call_names(&self) -> Vec<&str>
pub fn choice_tool_call_names(&self) -> Vec<&str>
Names of the tool calls in the aggregated choice, in order.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DrainedStream
impl !UnwindSafe for DrainedStream
impl Freeze for DrainedStream
impl Send for DrainedStream
impl Sync for DrainedStream
impl Unpin for DrainedStream
impl UnsafeUnpin 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> 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