pub struct ModelRegistry { /* private fields */ }Expand description
Central index of available models with alias resolution.
Stores ModelMeta entries and short aliases (e.g. “sonnet” → canonical id).
Create with ModelRegistry::with_builtins for a pre-populated registry.
Implementations§
Source§impl ModelRegistry
impl ModelRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Registry pre-populated with built-in models and aliases for Anthropic, OpenAI, and Google.
Sourcepub fn register_alias(
&mut self,
alias: impl Into<String>,
canonical_id: impl Into<String>,
)
pub fn register_alias( &mut self, alias: impl Into<String>, canonical_id: impl Into<String>, )
Register a short alias that maps to a canonical model id.
Sourcepub fn find_by_alias(&self, alias: &str) -> Option<&ModelMeta>
pub fn find_by_alias(&self, alias: &str) -> Option<&ModelMeta>
Resolve an alias to a model. Falls back to exact-id lookup if no alias matches.
Sourcepub fn list_by_provider(&self, provider: &str) -> Vec<&ModelMeta>
pub fn list_by_provider(&self, provider: &str) -> Vec<&ModelMeta>
Models from a specific provider.
Trait Implementations§
Source§impl Clone for ModelRegistry
impl Clone for ModelRegistry
Source§fn clone(&self) -> ModelRegistry
fn clone(&self) -> ModelRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ModelRegistry
impl Debug for ModelRegistry
Auto Trait Implementations§
impl Freeze for ModelRegistry
impl RefUnwindSafe for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
impl UnwindSafe for ModelRegistry
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