pub enum AgentEvent {
Show 13 variants
TurnStart {
turn: u32,
},
ThinkingDelta(String),
TextDelta(String),
AssistantText(String),
ToolCall {
id: String,
name: String,
input: Value,
},
ToolDenied {
name: String,
reason: String,
},
ToolResult {
id: String,
name: String,
is_error: bool,
content: String,
},
TurnUsage(Usage),
QueuedInput(String),
MessageDelivered {
id: String,
from: String,
},
Compacted {
messages_before: usize,
messages_after: usize,
prompt_tokens: u64,
},
Done(Box<RunOutcome>),
Nested {
tool: String,
id: Option<String>,
event: Box<AgentEvent>,
},
}Expand description
Everything the loop wants to tell an observer. The CLI renders these; a batch runner ignores all but the last.
Variants§
TurnStart
ThinkingDelta(String)
TextDelta(String)
AssistantText(String)
The complete assistant text for this turn, after streaming finishes.
ToolCall
ToolDenied
ToolResult
TurnUsage(Usage)
QueuedInput(String)
Text the user queued mid-run has just entered the conversation.
MessageDelivered
Another agent’s message has just entered the conversation, sender
taint merged first. See crate::mailbox.
Compacted
The transcript was summarised to fit the context window.
Done(Box<RunOutcome>)
Nested
Something happening inside a tool that contains a run of its own — a
subagent’s turn, seen from the parent. tool is the parent-visible
tool name; id is the parent’s tool_use id for the call, which is
what keeps two parallel delegations attributable; the boxed event is
the child’s own. A grandchild arrives already wrapped, so depth is
the nesting count.
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more