pub enum StreamingEvent {
PartialContentDelta {
content: String,
sequence_id: Option<u64>,
},
ThinkingDelta {
thinking: String,
tool_consideration: Option<String>,
},
ToolCallStarted {
tool_call_id: String,
tool_name: String,
index: Option<u32>,
},
PartialToolCall {
tool_call_id: String,
arguments: String,
index: Option<u32>,
is_complete: Option<bool>,
},
ToolCallEnded {
tool_call_id: String,
index: Option<u32>,
},
Metadata {
usage: Option<Value>,
finish_reason: Option<String>,
stop_reason: Option<String>,
},
FinalCandidate {
candidate_index: u32,
finish_reason: String,
},
StreamEnd {
finish_reason: Option<String>,
},
StreamError {
error: Value,
event_id: Option<String>,
},
}Expand description
Unified streaming event enum
Variants§
PartialContentDelta
Partial content delta (text streaming)
ThinkingDelta
Thinking delta (reasoning process)
ToolCallStarted
Tool call started
PartialToolCall
Partial tool call (arguments streaming)
ToolCallEnded
Tool call ended
Metadata
Metadata (usage, finish reason, etc.)
FinalCandidate
Final candidate (for multi-candidate scenarios)
StreamEnd
Stream end
StreamError
Stream error
Trait Implementations§
Source§impl Clone for StreamingEvent
impl Clone for StreamingEvent
Source§fn clone(&self) -> StreamingEvent
fn clone(&self) -> StreamingEvent
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 moreSource§impl Debug for StreamingEvent
impl Debug for StreamingEvent
Source§impl<'de> Deserialize<'de> for StreamingEvent
impl<'de> Deserialize<'de> for StreamingEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StreamingEvent
impl RefUnwindSafe for StreamingEvent
impl Send for StreamingEvent
impl Sync for StreamingEvent
impl Unpin for StreamingEvent
impl UnwindSafe for StreamingEvent
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