Skip to main content

ReasoningCapability

Struct ReasoningCapability 

Source
pub struct ReasoningCapability {
    pub control: ProviderReasoningControl,
    pub min_tier: Option<ReasoningTier>,
    pub max_tier: Option<ReasoningTier>,
    pub wire_tiers: Option<[ReasoningTier; 5]>,
}
Expand description

What a provider/model route can truthfully do with reasoning.

ProviderReasoningControl::NativeAdaptive is deliberately opt-in: it must only be set for a route that genuinely lets the provider choose its own thinking depth, established from the request-shaping source rather than asserted here.

Fields§

§control: ProviderReasoningControl

How much control the route actually expresses.

§min_tier: Option<ReasoningTier>

Lowest tier the route can actually run (always-thinking routes cannot honor off).

§max_tier: Option<ReasoningTier>

Highest tier the route can actually run.

§wire_tiers: Option<[ReasoningTier; 5]>

The tier the route actually expresses for each requested tier, in [off, low, medium, high, max] order.

min_tier/max_tier can only describe a floor and a ceiling. Real routes also collapse interior tiers: CodeWhale’s own route normalizer coerces low and medium to high on every non-Codex route while leaving off alone, which is a hole rather than a clamp and is therefore inexpressible as min/max. Recording the map is what keeps effective and provider_effective describing the request that was actually made instead of the tier the selector merely named — a receipt that says low for a request that carried high is exactly the invisible substitution this type exists to prevent.

None means the route expresses every requested tier faithfully. serde(default) keeps preflights written before this field readable.

Implementations§

Source§

impl ReasoningCapability

Source

pub const fn none() -> Self

A route with no reasoning support at all.

Source

pub const fn tiered() -> Self

A route with ordinary off..max tiers and no native adaptive mode.

Source

pub const fn enabled_disabled() -> Self

A route whose only provider-effective control is thinking on/off — the Z.AI GLM shape. Requested tiers are still recorded; they simply do not become distinct provider-effective tiers.

Source

pub const fn native_adaptive() -> Self

A route that truthfully performs provider-native adaptive thinking.

Source

pub fn with_wire_tiers(self, wire_tiers: [ReasoningTier; 5]) -> Self

Record what each requested tier actually becomes on the wire.

The identity map is stored as None, so a faithful route never carries a redundant table and never reports a normalization it did not perform.

Source

pub fn wire_tier(&self, tier: ReasoningTier) -> ReasoningTier

What the requested tier becomes on the wire, before floor/ceiling clamping. Identity for a route that expresses every tier faithfully.

Source

pub const fn supports_thinking(&self) -> bool

Whether the route accepts any thinking payload at all.

Source

pub const fn supports_native_adaptive(&self) -> bool

Whether the route performs provider-native adaptive thinking.

Source

pub fn normalize(&self, tier: ReasoningTier) -> (ReasoningTier, bool)

Resolve a requested tier into what the route can actually run. Returns the tier and whether normalization changed it.

The wire map is applied before the floor/ceiling clamps: a route that collapses low onto high has already decided what leaves the host, and a clamp cannot undo that. Any movement is reported, so the caller records capability_normalized rather than presenting the requested tier as the one that ran.

Source

pub const fn provider_effective( &self, tier: ReasoningTier, ) -> ProviderEffectiveReasoning

The control the provider actually receives for a selected tier.

Trait Implementations§

Source§

impl Clone for ReasoningCapability

Source§

fn clone(&self) -> ReasoningCapability

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ReasoningCapability

Source§

impl Debug for ReasoningCapability

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ReasoningCapability

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ReasoningCapability

Source§

impl PartialEq for ReasoningCapability

Source§

fn eq(&self, other: &ReasoningCapability) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ReasoningCapability

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ReasoningCapability

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.