pub struct ModelRegistry { /* private fields */ }Expand description
Model registry — manages all available models.
Implementations§
Source§impl ModelRegistry
impl ModelRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default model entries from providers.
Sourcepub fn register(&mut self, model: ModelEntry)
pub fn register(&mut self, model: ModelEntry)
Register a model.
Sourcepub fn get(&self, id: &str) -> Option<&ModelEntry>
pub fn get(&self, id: &str) -> Option<&ModelEntry>
Get a model by ID.
Sourcepub fn get_mut(&mut self, id: &str) -> Option<&mut ModelEntry>
pub fn get_mut(&mut self, id: &str) -> Option<&mut ModelEntry>
Get a mutable model by ID.
Sourcepub fn all(&self) -> Vec<&ModelEntry>
pub fn all(&self) -> Vec<&ModelEntry>
List all models.
Sourcepub fn enabled(&self) -> Vec<&ModelEntry>
pub fn enabled(&self) -> Vec<&ModelEntry>
List enabled models.
Sourcepub fn usable(&self) -> Vec<&ModelEntry>
pub fn usable(&self) -> Vec<&ModelEntry>
List usable models (enabled + available).
Sourcepub fn by_tier(&self, tier: CostTier) -> Vec<&ModelEntry>
pub fn by_tier(&self, tier: CostTier) -> Vec<&ModelEntry>
List models by tier.
Sourcepub fn set_available(&mut self, id: &str, available: bool)
pub fn set_available(&mut self, id: &str, available: bool)
Set model availability (based on credentials).
Sourcepub fn active(&self) -> Option<&ModelEntry>
pub fn active(&self) -> Option<&ModelEntry>
Get the active model.
Sourcepub fn recommend_for_subagent(
&self,
complexity: TaskComplexity,
) -> Option<&ModelEntry>
pub fn recommend_for_subagent( &self, complexity: TaskComplexity, ) -> Option<&ModelEntry>
Get recommended model for a sub-agent task.
Sourcepub fn set_subagent_default(
&mut self,
complexity: TaskComplexity,
model_id: String,
)
pub fn set_subagent_default( &mut self, complexity: TaskComplexity, model_id: String, )
Set the default model for a complexity level.
Sourcepub fn subagent_defaults(&self) -> &HashMap<TaskComplexity, String>
pub fn subagent_defaults(&self) -> &HashMap<TaskComplexity, String>
Get subagent defaults.
Trait Implementations§
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