pub enum ReasoningLevel {
Off,
Adaptive,
Low,
Medium,
High,
XHigh,
Max,
Ultra,
UltraCode,
}Expand description
A named reasoning / thinking depth level.
Ordering is from least to most intensive; Off < Adaptive < Low < … < Ultra.
Variants§
Off
No reasoning / thinking output.
Adaptive
Model decides reasoning depth automatically (Anthropic adaptive path).
Low
Low reasoning budget.
Medium
Medium reasoning budget.
High
High reasoning budget.
XHigh
Extra-high reasoning budget (above high, below max).
Max
Maximum named level (below ultra).
Ultra
Ultra — highest intensity, only a subset of Codex models supports this.
UltraCode
Anthropic-only logical xhigh plus standing workflow mode.
Implementations§
Source§impl ReasoningLevel
impl ReasoningLevel
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse a level from its canonical logical/config string.
Returns None for unknown strings; callers must not silently fallback.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The canonical logical/config representation.
Provider request planners own wire conversion. In particular, Codex
logical Ultra uses the exact catalog’s multi-agent wire effort (e.g.
Astra xhigh, Sol max) plus foreground proactive mode.
Sourcepub fn to_legacy_budget(self) -> Option<u32>
pub fn to_legacy_budget(self) -> Option<u32>
Convert to the legacy Anthropic token budget used by the enabled+budget_tokens
request shape. Returns None for levels that have no meaningful numeric
mapping (Max and Ultra are Codex execution modes, not numeric budgets).
Sourcepub fn from_legacy_budget(budget: u32) -> Self
pub fn from_legacy_budget(budget: u32) -> Self
Build from a legacy token budget value (Anthropic path).
0 → Adaptive, positive values → their tier. Does not produce Max
or Ultra — those are provider-named levels, never inferred from a budget.
Sourcepub fn requires_codex_support(self) -> bool
pub fn requires_codex_support(self) -> bool
All levels that are strictly above XHigh (require Codex-specific support).
Sourcepub fn requires_anthropic_support(self) -> bool
pub fn requires_anthropic_support(self) -> bool
Whether this level requires exact Anthropic mode capability evidence.
Trait Implementations§
Source§impl Clone for ReasoningLevel
impl Clone for ReasoningLevel
impl Copy for ReasoningLevel
Source§impl Debug for ReasoningLevel
impl Debug for ReasoningLevel
Source§impl Default for ReasoningLevel
impl Default for ReasoningLevel
Source§impl Display for ReasoningLevel
impl Display for ReasoningLevel
impl Eq for ReasoningLevel
Source§impl Hash for ReasoningLevel
impl Hash for ReasoningLevel
Source§impl Ord for ReasoningLevel
impl Ord for ReasoningLevel
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ReasoningLevel
impl PartialEq for ReasoningLevel
Source§impl PartialOrd for ReasoningLevel
impl PartialOrd for ReasoningLevel
impl StructuralPartialEq for ReasoningLevel
Auto Trait Implementations§
impl Freeze for ReasoningLevel
impl RefUnwindSafe for ReasoningLevel
impl Send for ReasoningLevel
impl Sync for ReasoningLevel
impl Unpin for ReasoningLevel
impl UnsafeUnpin for ReasoningLevel
impl UnwindSafe for ReasoningLevel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.