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 texts(&self) -> Vec<&str>
Available on crate features test-utils only.
pub fn texts(&self) -> Vec<&str>
test-utils only.Text deltas yielded to the consumer, in order.
Sourcepub fn tool_call_names(&self) -> Vec<&str>
Available on crate features test-utils only.
pub fn tool_call_names(&self) -> Vec<&str>
test-utils only.Names of the complete tool calls yielded to the consumer, in order.
Sourcepub fn unknown_values(&self) -> Vec<&Value>
Available on crate features test-utils only.
pub fn unknown_values(&self) -> Vec<&Value>
test-utils only.Raw payloads of the Unknown passthrough items the stream yielded,
in order.
Sourcepub fn error_count(&self) -> usize
Available on crate features test-utils only.
pub fn error_count(&self) -> usize
test-utils only.Number of Err items the stream yielded.
Sourcepub fn final_count(&self) -> usize
Available on crate features test-utils only.
pub fn final_count(&self) -> usize
test-utils only.Number of terminal records the stream yielded.
Sourcepub fn choice_texts(&self) -> Vec<&str>
Available on crate features test-utils only.
pub fn choice_texts(&self) -> Vec<&str>
test-utils only.Text blocks in the aggregated choice, in order.
Sourcepub fn choice_reasoning(&self) -> Vec<&Reasoning>
Available on crate features test-utils only.
pub fn choice_reasoning(&self) -> Vec<&Reasoning>
test-utils only.Reasoning items in the aggregated choice, in order.
Sourcepub fn choice_tool_call_names(&self) -> Vec<&str>
Available on crate features test-utils only.
pub fn choice_tool_call_names(&self) -> Vec<&str>
test-utils only.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