pub enum AgentEvent {
Show 15 variants
AgentStart {
session_id: Arc<str>,
},
AgentEnd {
session_id: Arc<str>,
messages: Vec<Message>,
error: Option<String>,
},
TurnStart {
session_id: Arc<str>,
turn_index: usize,
timestamp: i64,
},
TurnEnd {
session_id: Arc<str>,
turn_index: usize,
message: Message,
tool_results: Vec<Message>,
},
MessageStart {
message: Message,
},
MessageUpdate {
message: Message,
assistant_message_event: AssistantMessageEvent,
},
MessageEnd {
message: Message,
},
ToolExecutionStart {
tool_call_id: String,
tool_name: String,
args: Value,
},
ToolExecutionUpdate {
tool_call_id: String,
tool_name: String,
args: Value,
partial_result: ToolOutput,
},
ToolExecutionEnd {
tool_call_id: String,
tool_name: String,
result: ToolOutput,
is_error: bool,
},
AutoCompactionStart {
reason: String,
},
AutoCompactionEnd {
result: Option<Value>,
aborted: bool,
will_retry: bool,
error_message: Option<String>,
},
AutoRetryStart {
attempt: u32,
max_attempts: u32,
delay_ms: u64,
error_message: String,
},
AutoRetryEnd {
success: bool,
attempt: u32,
final_error: Option<String>,
},
ExtensionError {
extension_id: Option<String>,
event: String,
error: String,
},
}Expand description
Events emitted by the agent during execution.
Variants§
AgentStart
Agent lifecycle start.
AgentEnd
Agent lifecycle end with all new messages.
TurnStart
Turn lifecycle start (assistant response + tool calls).
TurnEnd
Turn lifecycle end with tool results.
MessageStart
Message lifecycle start (user, assistant, or tool result).
MessageUpdate
Message update (assistant streaming).
MessageEnd
Message lifecycle end.
ToolExecutionStart
Tool execution start.
ToolExecutionUpdate
Tool execution update.
ToolExecutionEnd
Tool execution end.
AutoCompactionStart
Auto-compaction lifecycle start.
AutoCompactionEnd
Auto-compaction lifecycle end.
AutoRetryStart
Auto-retry lifecycle start.
AutoRetryEnd
Auto-retry lifecycle end.
ExtensionError
Extension error during event dispatch or execution.
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 moreSource§impl Debug for AgentEvent
impl Debug 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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
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 moreSource§impl<T> ModelDump for Twhere
T: Serialize,
impl<T> ModelDump for Twhere
T: Serialize,
Source§fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
Serialize a model to a JSON value. Read more
Source§fn model_dump_json(&self) -> Result<String, Error>
fn model_dump_json(&self) -> Result<String, Error>
Serialize a model to a JSON string with default options.
Source§fn model_dump_json_pretty(&self) -> Result<String, Error>
fn model_dump_json_pretty(&self) -> Result<String, Error>
Serialize a model to a pretty-printed JSON string.
Source§fn model_dump_json_with_options(
&self,
options: DumpOptions,
) -> Result<String, Error>
fn model_dump_json_with_options( &self, options: DumpOptions, ) -> Result<String, Error>
Serialize a model to a JSON string with full options support. Read more