pub struct RouteResolver { /* private fields */ }Expand description
Resolves RouteRequests into ReadyRouteCandidates.
Implementations§
Source§impl RouteResolver
impl RouteResolver
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a resolver with CodeWhale’s bundled offline offerings.
The default offerings are the committed Models.dev-shaped catalog asset
(crate::catalog::bundled_catalog_offerings, real context windows and
honest per-row cost) merged with the tiny hand seam
(bundled_offerings). The hand seam is kept and given precedence on a
(provider, wire id) collision: it encodes the curated canonical-model
joins the route invariants depend on (e.g. a DeepSeek-native row and the
aggregator rows that map a prefixed wire id back to deepseek-v4-pro),
which generated Models.dev JSON does not prove. Asset-only rows (GLM,
Kimi, MiniMax, Qwen, …) add the real provider/model facts the picker and
candidates were previously missing.
Sourcepub fn from_offerings(offerings: Vec<ProviderModelOffering>) -> Self
pub fn from_offerings(offerings: Vec<ProviderModelOffering>) -> Self
Construct a resolver from a provider-scoped offering catalog.
This is the bridge for Models.dev snapshots: callers parse a catalog, emit provider offerings, then hand those rows to the resolver without changing route-resolution semantics.
Sourcepub fn resolve(
&self,
req: &RouteRequest,
) -> Result<ReadyRouteCandidate, RouteError>
pub fn resolve( &self, req: &RouteRequest, ) -> Result<ReadyRouteCandidate, RouteError>
Resolve a request into an executable route candidate.
§Errors
Returns RouteError when the model is empty, the provider is invalid,
or a clearly-foreign model is requested for a strict direct provider.
Trait Implementations§
Source§impl Clone for RouteResolver
impl Clone for RouteResolver
Source§fn clone(&self) -> RouteResolver
fn clone(&self) -> RouteResolver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more