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: ProviderReasoningControlHow 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
impl ReasoningCapability
Sourcepub const fn tiered() -> Self
pub const fn tiered() -> Self
A route with ordinary off..max tiers and no native adaptive mode.
Sourcepub const fn enabled_disabled() -> Self
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.
Sourcepub const fn native_adaptive() -> Self
pub const fn native_adaptive() -> Self
A route that truthfully performs provider-native adaptive thinking.
Sourcepub fn with_wire_tiers(self, wire_tiers: [ReasoningTier; 5]) -> Self
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.
Sourcepub fn wire_tier(&self, tier: ReasoningTier) -> ReasoningTier
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.
Sourcepub const fn supports_thinking(&self) -> bool
pub const fn supports_thinking(&self) -> bool
Whether the route accepts any thinking payload at all.
Sourcepub const fn supports_native_adaptive(&self) -> bool
pub const fn supports_native_adaptive(&self) -> bool
Whether the route performs provider-native adaptive thinking.
Sourcepub fn normalize(&self, tier: ReasoningTier) -> (ReasoningTier, bool)
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.
Sourcepub const fn provider_effective(
&self,
tier: ReasoningTier,
) -> ProviderEffectiveReasoning
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
impl Clone for ReasoningCapability
Source§fn clone(&self) -> ReasoningCapability
fn clone(&self) -> ReasoningCapability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more