pub enum AgentEvent {
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),
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.
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 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