#[non_exhaustive]pub enum StreamChunk {
Text {
step_index: u32,
text: String,
},
Thought {
step_index: u32,
text: String,
},
ToolCall(ToolCall),
ToolResult(ToolResult),
}Expand description
A single semantic event emitted while a turn is in flight.
Text and Thought carry incremental deltas (already split into
human-readable chunks). ToolCall and ToolResult carry strongly typed
dispatches so consumers can render spinners without parsing JSON.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
Incremental conversational text delta.
Thought
Incremental reasoning/thinking delta.
Fields
ToolCall(ToolCall)
The model is requesting a tool call.
ToolResult(ToolResult)
A tool call completed with a result.
Trait Implementations§
Source§impl Clone for StreamChunk
impl Clone for StreamChunk
Source§fn clone(&self) -> StreamChunk
fn clone(&self) -> StreamChunk
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamChunk
impl Debug for StreamChunk
Source§impl PartialEq for StreamChunk
impl PartialEq for StreamChunk
Source§fn eq(&self, other: &StreamChunk) -> bool
fn eq(&self, other: &StreamChunk) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamChunk
Auto Trait Implementations§
impl Freeze for StreamChunk
impl RefUnwindSafe for StreamChunk
impl Send for StreamChunk
impl Sync for StreamChunk
impl Unpin for StreamChunk
impl UnsafeUnpin for StreamChunk
impl UnwindSafe for StreamChunk
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