pub enum AgentSessionEvent {
Show 15 variants
Message {
role: String,
content: String,
timestamp: u64,
},
ToolStart {
tool_name: String,
input: Value,
},
ToolEnd {
tool_name: String,
output: Result<Value, String>,
duration_ms: u64,
},
Error {
message: String,
recoverable: bool,
},
ModelStart {
model_id: String,
},
ModelEnd {
model_id: String,
duration_ms: u64,
tokens_used: Option<u32>,
},
TokenUsage {
input_tokens: u32,
output_tokens: u32,
cached_tokens: Option<u32>,
},
SessionStart {
session_id: String,
},
SessionEnd {
session_id: String,
total_messages: u32,
},
ThinkingStart,
ThinkingEnd {
thoughts: String,
},
StreamChunk {
content: String,
},
ToolCall {
tool_name: String,
arguments: Value,
},
ToolResult {
tool_name: String,
result: Value,
},
Custom {
name: String,
data: Value,
},
}Expand description
Event types for the agent session
Variants§
Message
A new message was received or sent
ToolStart
A tool started executing
ToolEnd
A tool finished executing
Error
An error occurred
ModelStart
Model started generating a response
ModelEnd
Model finished generating a response
TokenUsage
Token usage update
SessionStart
Session started
SessionEnd
Session ended
ThinkingStart
Thinking block started
ThinkingEnd
Thinking block ended
StreamChunk
Stream chunk received
ToolCall
Tool call requested
ToolResult
Tool result received
Custom
Custom event from extensions
Trait Implementations§
Source§impl Clone for AgentSessionEvent
impl Clone for AgentSessionEvent
Source§fn clone(&self) -> AgentSessionEvent
fn clone(&self) -> AgentSessionEvent
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 AgentSessionEvent
impl RefUnwindSafe for AgentSessionEvent
impl Send for AgentSessionEvent
impl Sync for AgentSessionEvent
impl Unpin for AgentSessionEvent
impl UnsafeUnpin for AgentSessionEvent
impl UnwindSafe for AgentSessionEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more