pub enum TextStreamPart {
TextDelta(String),
ToolCall(ToolCallPart),
ToolResult(ToolResultPart),
StepFinish {
step_index: u32,
finish_reason: FinishReason,
},
Finish {
total_usage: Usage,
},
}Expand description
A part of the text stream.
This enum represents the different types of events that can occur during streaming.
Variants§
TextDelta(String)
A delta of text generated by the model.
ToolCall(ToolCallPart)
A tool call generated by the model.
ToolResult(ToolResultPart)
The result of a tool execution.
StepFinish
Indicates that a step (LLM call) has finished.
Fields
§
finish_reason: FinishReasonThe reason why the step finished.
Finish
Indicates that the entire generation process has finished.
Trait Implementations§
Source§impl Clone for TextStreamPart
impl Clone for TextStreamPart
Source§fn clone(&self) -> TextStreamPart
fn clone(&self) -> TextStreamPart
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 TextStreamPart
impl RefUnwindSafe for TextStreamPart
impl Send for TextStreamPart
impl Sync for TextStreamPart
impl Unpin for TextStreamPart
impl UnwindSafe for TextStreamPart
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