Skip to main content

AgentRunState

Enum AgentRunState 

Source
#[non_exhaustive]
pub enum AgentRunState { Done { total_turns: u32, total_usage: TokenUsage, }, Refusal { total_turns: u32, total_usage: TokenUsage, }, Error(AgentError), AwaitingConfirmation { tool_call_id: String, tool_name: String, display_name: String, input: Value, description: String, continuation: Box<ContinuationEnvelope>, }, Cancelled { total_turns: u32, total_usage: TokenUsage, }, }
Expand description

Outcome of running the agent loop.

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.
§

Done

Agent completed successfully.

Fields

§total_turns: u32
§total_usage: TokenUsage
§

Refusal

Agent was refused by the model (safety/policy).

Fields

§total_turns: u32
§total_usage: TokenUsage
§

Error(AgentError)

Agent encountered an error.

§

AwaitingConfirmation

Agent is awaiting confirmation for a tool call. The application should present this to the user and call resume.

Fields

§tool_call_id: String

ID of the pending tool call (from LLM)

§tool_name: String

Tool name string (for LLM protocol)

§display_name: String

Human-readable display name

§input: Value

Tool input parameters

§description: String

Description of what confirmation is needed

§continuation: Box<ContinuationEnvelope>

Versioned continuation envelope for resuming.

§

Cancelled

Agent run was cancelled via a cancellation token.

Fields

§total_turns: u32
§total_usage: TokenUsage

Trait Implementations§

Source§

impl Debug for AgentRunState

Source§

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

Formats the value using the given formatter. Read more

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> 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, 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.