pub enum ExitReason {
Show 13 variants
Completed,
MaxTurns {
max_turns: u32,
turn_count: u32,
},
AbortedStreaming {
reason: String,
},
AbortedTools {
reason: String,
},
HookStopped,
StopHookPrevented,
PromptTooLong {
error: Option<String>,
},
ImageError {
error: String,
},
ModelError {
error: String,
},
BlockingLimit,
TokenBudgetExhausted {
reason: String,
},
MaxTokens,
MaxBudgetExceeded {
max_budget_usd: f64,
},
}Expand description
Exit reasons from the query loop (matches TypeScript Terminal type)
Variants§
Completed
Normal completion - no more tool calls needed
MaxTurns
Maximum turns reached
AbortedStreaming
Aborted during model streaming
AbortedTools
Aborted during tool execution
HookStopped
Hook prevented continuation
StopHookPrevented
Stop hook prevented continuation
PromptTooLong
Context too long (prompt_too_long)
ImageError
Media error (image too large, etc.)
ModelError
Model/runtime error
BlockingLimit
Token limit reached (blocking_limit)
TokenBudgetExhausted
Token budget continuation ended early
MaxTokens
Max output tokens reached (during generation)
MaxBudgetExceeded
USD budget exceeded
Trait Implementations§
Source§impl Clone for ExitReason
impl Clone for ExitReason
Source§fn clone(&self) -> ExitReason
fn clone(&self) -> ExitReason
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExitReason
impl Debug for ExitReason
Source§impl Default for ExitReason
impl Default for ExitReason
Source§impl<'de> Deserialize<'de> for ExitReason
impl<'de> Deserialize<'de> for ExitReason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ExitReason
impl RefUnwindSafe for ExitReason
impl Send for ExitReason
impl Sync for ExitReason
impl Unpin for ExitReason
impl UnsafeUnpin for ExitReason
impl UnwindSafe for ExitReason
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