pub enum AgentEvent {
Show 15 variants
RunStarted {
session_id: SessionId,
},
TurnStarted {
session_id: SessionId,
turn_id: TurnId,
},
InputAccepted {
session_id: SessionId,
items: Vec<Item>,
},
ContentDelta(Delta),
ToolCallRequested(ToolCallPart),
ApprovalRequired(ApprovalRequest),
AuthRequired(AuthRequest),
ApprovalResolved {
approved: bool,
},
AuthResolved {
provided: bool,
},
CompactionStarted {
session_id: SessionId,
turn_id: Option<TurnId>,
reason: CompactionReason,
},
CompactionFinished {
session_id: SessionId,
turn_id: Option<TurnId>,
replaced_items: usize,
transcript_len: usize,
metadata: BTreeMap<String, Value>,
},
UsageUpdated(Usage),
Warning {
message: String,
},
RunFailed {
message: String,
},
TurnFinished(TurnResult),
}Expand description
Lifecycle and streaming events emitted by the LoopDriver.
Observers (see LoopObserver) receive these events in the order they
occur. They are useful for building UIs, logging, or telemetry.
Variants§
RunStarted
The agent run has been initialised.
TurnStarted
A new model turn is starting.
InputAccepted
User input has been accepted into the pending queue.
ContentDelta(Delta)
Incremental content delta from the model.
ToolCallRequested(ToolCallPart)
The model has requested a tool call.
ApprovalRequired(ApprovalRequest)
A tool call requires explicit user approval before execution.
AuthRequired(AuthRequest)
A tool call requires authentication before execution.
ApprovalResolved
An approval interrupt has been resolved.
AuthResolved
An authentication interrupt has been resolved.
CompactionStarted
Transcript compaction is about to begin.
CompactionFinished
Transcript compaction has finished.
Fields
UsageUpdated(Usage)
Updated token usage statistics.
Warning
Non-fatal warning (e.g. a tool failure that was recovered from).
RunFailed
The agent run has failed with an unrecoverable error.
TurnFinished(TurnResult)
A turn has finished (successfully, via cancellation, etc.).
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more