pub enum AgentEvent {
Show 13 variants
ToolStart {
tool_name: String,
tool_call_id: String,
input: Value,
},
ToolComplete {
tool_name: String,
tool_call_id: String,
result: ToolResult,
},
ToolError {
tool_name: String,
tool_call_id: String,
error: String,
},
Thinking {
turn: u32,
},
Done {
result: QueryResult,
},
MessageStart {
message_id: String,
},
ContentBlockStart {
index: u32,
block_type: String,
},
ContentBlockDelta {
index: u32,
delta: ContentDelta,
},
ContentBlockStop {
index: u32,
},
MessageStop,
RequestStart,
MaxTurnsReached {
max_turns: u32,
turn_count: u32,
},
Tombstone {
message: String,
},
}Expand description
Agent event types for streaming updates (matches TypeScript behavior)
Variants§
ToolStart
Tool is about to be executed
ToolComplete
Tool execution completed
ToolError
Tool execution failed
Thinking
LLM is thinking (started a new turn)
Done
Final response ready
Fields
§
result: QueryResultMessageStart
Message started (streaming begins)
ContentBlockStart
Content block started (matches TypeScript StreamEvent content_block_start)
ContentBlockDelta
Content block delta (matches TypeScript StreamEvent content_block_delta)
ContentBlockStop
Content block stopped (matches TypeScript StreamEvent content_block_stop)
MessageStop
Message stopped (streaming ends)
RequestStart
Request started (before API call) - matches TypeScript ‘stream_request_start’
MaxTurnsReached
Max turns reached - matches TypeScript ‘max_turns_reached’ attachment
Tombstone
Tombstone event for orphaned messages on streaming fallback (matches TypeScript ‘tombstone’ event)
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 · 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 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