Skip to main content

AgentEvent

Enum AgentEvent 

Source
pub enum AgentEvent {
    Started,
    Status(String),
    Usage {
        input_tokens: u64,
        output_tokens: u64,
    },
    AssistantDelta(String),
    ReasoningDelta(String),
    ToolStarted {
        id: String,
        name: String,
        arguments: String,
    },
    ToolFinished {
        id: String,
        output: Vec<String>,
        status: ToolStatus,
    },
    ModelMetadataLoaded(Vec<(String, String)>),
    Retrying {
        attempt: u32,
        max_attempts: u32,
        delay_ms: u64,
        error: String,
    },
    Finished,
    Failed(String),
    Cancelled,
}
Expand description

Provider-neutral semantic output from an agent turn.

Application adapters may attach local-tool audit details, UI state, or transport state when projecting these events to their own surfaces.

Variants§

§

Started

A turn started.

§

Status(String)

Informational provider or run status.

§

Usage

Incremental token accounting.

Fields

§input_tokens: u64

Number of input tokens observed for the request or increment.

§output_tokens: u64

Number of output tokens observed for the request or increment.

§

AssistantDelta(String)

Incremental assistant text.

§

ReasoningDelta(String)

Incremental reasoning text.

§

ToolStarted

A tool call was requested.

Fields

§id: String

Provider-assigned id for the tool call.

§name: String

Application catalog name selected for the call.

§arguments: String

Raw JSON arguments supplied for the call.

§

ToolFinished

A tool call completed.

Fields

§id: String

Provider-assigned id for the tool call.

§output: Vec<String>

Output lines returned by the application-owned executor.

§status: ToolStatus

Final execution status.

§

ModelMetadataLoaded(Vec<(String, String)>)

Model metadata available for application model pickers.

§

Retrying

A retry was scheduled after a recoverable provider failure.

Fields

§attempt: u32

One-based retry attempt that will run next.

§max_attempts: u32

Maximum retry attempts configured for the request.

§delay_ms: u64

Delay before the next attempt, in milliseconds.

§error: String

Redacted, provider-neutral failure detail.

§

Finished

The turn completed normally.

§

Failed(String)

The turn failed recoverably.

§

Cancelled

The turn was cancelled cooperatively.

Trait Implementations§

Source§

impl Clone for AgentEvent

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgentEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AgentEvent

Source§

impl PartialEq for AgentEvent

Source§

fn eq(&self, other: &AgentEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AgentEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.