#[non_exhaustive]pub enum AgentEvent {
TextDelta(String),
TurnCompleted,
ToolCallStarted {
id: String,
name: String,
arguments: String,
},
ToolCallCompleted {
id: String,
name: String,
output: String,
is_error: bool,
},
}Expand description
Streaming events emitted by an crate::Agent as a turn unfolds.
Attach an EventSink to a crate::Config to observe these live — for
example to render tokens to a terminal as they arrive, or to surface tool
activity in a UI.
#[non_exhaustive] because new event kinds will be added over time; match
with a _ arm so a new variant is not a breaking change.
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.
TextDelta(String)
A chunk of assistant text was produced.
TurnCompleted
The assistant finished a text/tool turn (one round-trip to the model).
ToolCallStarted
The model requested a tool call (fired before the tool runs).
Fields
ToolCallCompleted
A tool finished running.
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