#[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.
Refusal
Agent was refused by the model (safety/policy).
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
§
continuation: Box<ContinuationEnvelope>Versioned continuation envelope for resuming.
Cancelled
Agent run was cancelled via a cancellation token.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentRunState
impl RefUnwindSafe for AgentRunState
impl Send for AgentRunState
impl Sync for AgentRunState
impl Unpin for AgentRunState
impl UnsafeUnpin for AgentRunState
impl UnwindSafe for AgentRunState
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