pub enum StreamChunk {
Text(String),
ToolUse {
id: String,
name: String,
},
ToolInputDelta {
id: String,
partial_json: String,
},
ToolCall {
call_id: String,
response_id: String,
chat_id: Option<String>,
tool_name: String,
server: String,
parameters: Value,
},
Usage(Usage),
Done,
}Expand description
Streaming chunk from a chat completion
Variants§
Text(String)
Text delta
ToolUse
Tool use started.
ToolInputDelta
Tool input delta (partial JSON streaming).
Fields
ToolCall
Tool call request from backend (for client-side execution).
Fields
Usage(Usage)
Usage statistics (usually sent at the end)
Done
Stream completed
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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