pub enum TurnOutcome {
NeedsMoreTurns {
turn: usize,
turn_usage: TokenUsage,
total_usage: TokenUsage,
},
Done {
total_turns: u32,
input_tokens: u64,
output_tokens: u64,
},
AwaitingConfirmation {
tool_call_id: String,
tool_name: String,
display_name: String,
input: Value,
description: String,
continuation: Box<AgentContinuation>,
},
Error(AgentError),
}Expand description
Outcome of running a single turn.
This is returned by run_turn to indicate what happened and what to do next.
Variants§
NeedsMoreTurns
Turn completed successfully, but more turns are needed.
Tools were executed and their results are stored in the message history.
Call run_turn again with AgentInput::Continue to proceed.
Fields
§
turn_usage: TokenUsageToken usage for this turn
§
total_usage: TokenUsageCumulative token usage so far
Done
Agent completed successfully (no more tool calls).
Fields
AwaitingConfirmation
A tool requires user confirmation.
Present this to the user and call run_turn with AgentInput::Resume
to continue.
Fields
§
continuation: Box<AgentContinuation>Continuation state for resuming (boxed for enum size efficiency)
Error(AgentError)
An error occurred.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TurnOutcome
impl RefUnwindSafe for TurnOutcome
impl Send for TurnOutcome
impl Sync for TurnOutcome
impl Unpin for TurnOutcome
impl UnwindSafe for TurnOutcome
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