pub enum AgentEvent {
IterationStart {
iteration: usize,
max_iterations: usize,
},
TextDelta(String),
ToolStart {
name: String,
arguments: String,
},
ToolResult {
name: String,
success: bool,
output: String,
},
PermissionResult {
tool: String,
allowed: bool,
},
ContextCompacted {
messages_before: usize,
messages_after: usize,
prompt_tokens: usize,
context_size: u32,
},
Completed {
reason: CompletionReason,
},
Error(String),
}Expand description
Events emitted by the agent loop.
Variants§
IterationStart
The agent is starting a new iteration.
TextDelta(String)
A text chunk was generated by the model.
ToolStart
The agent is about to call a tool.
ToolResult
A tool returned a result.
PermissionResult
Permission was requested and granted/denied.
ContextCompacted
Context was automatically compacted.
Completed
The agent completed its response.
Fields
§
reason: CompletionReasonError(String)
An error occurred during the loop.
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