pub enum AgentEvent {
AgentStart,
AgentEnd {
messages: Vec<Message>,
},
TurnStart,
TurnEnd {
message: AssistantMessage,
tool_results: Vec<ToolResultMessage>,
},
MessageStart(Message),
MessageUpdate {
event: AssistantMessageEvent,
},
MessageEnd(Message),
ToolExecutionStart {
tool_call_id: String,
tool_name: String,
args: Value,
},
ToolExecutionEnd {
tool_call_id: String,
tool_name: String,
is_error: bool,
},
Usage(Usage),
Error(String),
}Expand description
Events emitted by the agent loop for UI updates. Mirrors pi’s AgentEvent.
Variants§
AgentStart
AgentEnd
TurnStart
TurnEnd
MessageStart(Message)
MessageUpdate
Fine-grained streaming event for an in-progress assistant message. The renderer applies deltas incrementally (no full-message clone needed).
Fields
§
event: AssistantMessageEventMessageEnd(Message)
ToolExecutionStart
ToolExecutionEnd
Usage(Usage)
Aggregated token usage for the most recent assistant turn.
Error(String)
A fatal agent error (loop could not complete).
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§impl Debug for AgentEvent
impl Debug for AgentEvent
Auto Trait Implementations§
impl Forget for AgentEvent
impl Freeze for AgentEvent
impl Move 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