pub enum AgentEvent {
Token(String),
ToolCall(ToolCallInfo),
ToolResult(ToolCallResult),
}Expand description
Events emitted by AgentStream.
Each variant represents a distinct, self-contained event in the agent lifecycle:
Token(String)— a text fragment from the assistant. In streaming mode eachTokenis a single SSE delta; in non-streaming mode the full response text arrives as oneToken.ToolCall(ToolCallInfo)— the model has requested a tool invocation. One event is emitted per call, before execution begins.ToolResult(ToolCallResult)— a tool has finished executing. One event is emitted per call, in the same order as the correspondingToolCallevents.
Variants§
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