#[non_exhaustive]pub enum AgentEvent {
TurnStart,
TextDelta {
delta: String,
},
ThinkingDelta {
delta: String,
},
ReasoningComplete {
blocks: Vec<ReasoningBlock>,
},
ToolCallStarted {
name: String,
},
ToolCall {
call: ToolCall,
provenance: ToolProvenance,
summary_fields: Vec<String>,
},
ToolResult {
result: MessageToolResult,
},
TurnEnd {
stop_reason: StopReason,
usage: Usage,
},
Error {
message: String,
},
}Expand description
Events emitted during a turn for streaming.
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.
TurnStart
Turn has started.
TextDelta
A text delta was received from the provider.
ThinkingDelta
A transient thinking/reasoning delta was received from the provider.
Thinking deltas are live UI preview data. They must not be persisted as normal conversation history or included in the final assistant text.
ReasoningComplete
Emitted once per provider response, before TurnEnd, when the response
carried reasoning blocks. Durable replay payload; never display content.
Fields
§
blocks: Vec<ReasoningBlock>Provider-native reasoning blocks in stream order.
ToolCallStarted
Tool call detected: parameters still streaming.
ToolCall
A tool call was requested.
Fields
§
provenance: ToolProvenanceThe provenance of the tool being called.
ToolResult
A tool call completed.
Fields
§
result: MessageToolResultThe tool result.
TurnEnd
Turn has ended.
Error
An error occurred.
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
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 AgentEvent
impl Debug for AgentEvent
Source§impl<'de> Deserialize<'de> for AgentEvent
impl<'de> Deserialize<'de> for AgentEvent
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
Source§impl PartialEq for AgentEvent
impl PartialEq for AgentEvent
Source§impl Serialize for AgentEvent
impl Serialize for AgentEvent
impl StructuralPartialEq for AgentEvent
Auto Trait Implementations§
impl Freeze for AgentEvent
impl RefUnwindSafe for AgentEvent
impl Send for AgentEvent
impl Sync for AgentEvent
impl Unpin for AgentEvent
impl UnsafeUnpin for AgentEvent
impl UnwindSafe for AgentEvent
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