pub struct ModelRegistry { /* private fields */ }Expand description
Model registry - manages providers and models at runtime
Implementations§
Source§impl ModelRegistry
impl ModelRegistry
Sourcepub fn register_builtin_provider(
&self,
id: String,
name: String,
models: Vec<Model>,
) -> Result<(), RegistryError>
pub fn register_builtin_provider( &self, id: String, name: String, models: Vec<Model>, ) -> Result<(), RegistryError>
Register a built-in provider
Sourcepub fn register_extension_provider(
&self,
provider: Arc<dyn Provider>,
) -> Result<(), RegistryError>
pub fn register_extension_provider( &self, provider: Arc<dyn Provider>, ) -> Result<(), RegistryError>
Register an extension provider
Sourcepub fn unregister_provider(
&self,
provider_id: &str,
) -> Result<(), RegistryError>
pub fn unregister_provider( &self, provider_id: &str, ) -> Result<(), RegistryError>
Unregister a provider
Sourcepub fn get_provider(&self, provider_id: &str) -> Option<ProviderInfo>
pub fn get_provider(&self, provider_id: &str) -> Option<ProviderInfo>
Get provider info
Sourcepub fn list_providers(&self) -> Vec<ProviderInfo>
pub fn list_providers(&self) -> Vec<ProviderInfo>
Get all providers
Sourcepub fn list_models(&self) -> Vec<Model>
pub fn list_models(&self) -> Vec<Model>
Get all models across all providers
Sourcepub fn list_provider_models(&self, provider_id: &str) -> Vec<Model>
pub fn list_provider_models(&self, provider_id: &str) -> Vec<Model>
Get models for a specific provider
Sourcepub fn update_auth_status(
&self,
provider_id: &str,
status: AuthStatus,
) -> Result<(), RegistryError>
pub fn update_auth_status( &self, provider_id: &str, status: AuthStatus, ) -> Result<(), RegistryError>
Update provider authentication status
Sourcepub fn get_auth_status(&self, provider_id: &str) -> Option<AuthStatus>
pub fn get_auth_status(&self, provider_id: &str) -> Option<AuthStatus>
Get provider authentication status
Sourcepub async fn refresh_catalog(&self) -> Result<(), RegistryError>
pub async fn refresh_catalog(&self) -> Result<(), RegistryError>
Refresh model catalog from models.json
Sourcepub fn last_refresh_time(&self) -> Option<Instant>
pub fn last_refresh_time(&self) -> Option<Instant>
Get last catalog refresh time
Sourcepub fn subscribe(&self) -> Receiver<ModelRegistryEvent>
pub fn subscribe(&self) -> Receiver<ModelRegistryEvent>
Subscribe to registry events
Sourcepub fn get_provider_instance(
&self,
provider_id: &str,
) -> Option<Arc<dyn Provider>>
pub fn get_provider_instance( &self, provider_id: &str, ) -> Option<Arc<dyn Provider>>
Get provider instance for API calls
Sourcepub fn has_provider(&self, provider_id: &str) -> bool
pub fn has_provider(&self, provider_id: &str) -> bool
Check if a provider is registered
Sourcepub fn provider_count(&self) -> usize
pub fn provider_count(&self) -> usize
Get provider count
Sourcepub fn model_count(&self) -> usize
pub fn model_count(&self) -> usize
Get model count
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().