#[non_exhaustive]pub enum AgentEvent {
TurnStart {
turn: u32,
},
LlmStreamEvent {
event: StreamEventRef,
},
ToolExecuting {
tool_use_id: String,
name: String,
input: ToolInput,
},
ToolComplete {
tool_use_id: String,
name: String,
result: Option<ToolResult>,
error: Option<String>,
},
ContextCompacted {
old_tokens: usize,
new_tokens: usize,
},
TurnComplete {
turn: u32,
message: AssistantMessage,
usage: Usage,
},
Complete {
result: AgentResult,
},
}Expand description
Events emitted during an agent run (for streaming / observability).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TurnStart
A new turn is starting.
LlmStreamEvent
An LLM streaming event was received.
Fields
§
event: StreamEventRefStreaming event received from the LLM provider.
ToolExecuting
A tool is about to be executed.
Fields
ToolComplete
A tool call completed.
Fields
§
result: Option<ToolResult>Successful tool result, when available.
ContextCompacted
Context was compacted to fit within the token budget.
Fields
TurnComplete
A turn completed.
Fields
§
message: AssistantMessageAssistant message produced by the turn.
Complete
The agent run is complete.
Fields
§
result: AgentResultFinal agent result.
Auto Trait Implementations§
impl !RefUnwindSafe for AgentEvent
impl !UnwindSafe for AgentEvent
impl Freeze for AgentEvent
impl Send for AgentEvent
impl Sync for AgentEvent
impl Unpin for AgentEvent
impl UnsafeUnpin 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