#[non_exhaustive]pub enum AgentEvent {
AgentStart,
AgentEnd {
messages: Vec<AgentMessage>,
},
TurnStart,
TurnEnd {
message: AgentMessage,
tool_results: Vec<ToolResultMessage>,
},
MessageStart {
message: AgentMessage,
},
MessageUpdate {
message: AgentMessage,
assistant_event: Box<AssistantStreamEvent>,
},
MessageEnd {
message: AgentMessage,
},
ToolExecutionStart {
tool_call_id: String,
tool_name: String,
args: Value,
},
ToolExecutionUpdate {
tool_call_id: String,
tool_name: String,
args: Value,
partial_result: Value,
},
ToolExecutionEnd {
tool_call_id: String,
tool_name: String,
result: Value,
is_error: bool,
},
QueueUpdate {
steering: Vec<String>,
follow_up: Vec<String>,
},
}Expand description
Events emitted during the agent loop lifecycle.
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.
AgentStart
The agent loop has started.
AgentEnd
The agent loop has ended. No more loop events will be emitted.
Fields
§
messages: Vec<AgentMessage>TurnStart
A new turn (provider request/response cycle) has started.
TurnEnd
A turn has ended with the assistant message and any tool results.
MessageStart
An assistant message has started streaming.
Fields
§
message: AgentMessageMessageUpdate
An assistant message has been updated with a stream event.
MessageEnd
An assistant message has finished streaming.
Fields
§
message: AgentMessageToolExecutionStart
Tool execution is about to begin.
ToolExecutionUpdate
Tool execution has produced a progress update.
ToolExecutionEnd
Tool execution has completed.
QueueUpdate
Queue messages were delivered to the conversation.
Trait Implementations§
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