pub struct CachedModelRegistry<'a> { /* private fields */ }Expand description
Cached model registry with HTTP client and TTL support.
Implementations§
Source§impl CachedModelRegistry<'_>
impl CachedModelRegistry<'_>
Sourcepub fn new(
cache_dir: Option<PathBuf>,
ttl_seconds: u64,
token_provider: &dyn TokenProvider,
) -> CachedModelRegistry<'_>
pub fn new( cache_dir: Option<PathBuf>, ttl_seconds: u64, token_provider: &dyn TokenProvider, ) -> CachedModelRegistry<'_>
Create a new cached model registry.
§Arguments
cache_dir- Directory for storing cached model lists (None to disable caching)ttl_seconds- Time-to-live for cache entries (seeDEFAULT_MODEL_TTL_SECS)token_provider- Token provider for API credentials
Trait Implementations§
Source§impl ModelRegistry for CachedModelRegistry<'_>
impl ModelRegistry for CachedModelRegistry<'_>
Source§fn list_models<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CachedModel>, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_models<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CachedModel>, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all available models for a provider.
Source§fn model_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
model_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn model_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
model_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Check if a model exists for a provider.
Source§fn validate_model<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
model_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate_model<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
model_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validate that a model ID exists for a provider.
Auto Trait Implementations§
impl<'a> Freeze for CachedModelRegistry<'a>
impl<'a> !RefUnwindSafe for CachedModelRegistry<'a>
impl<'a> Send for CachedModelRegistry<'a>
impl<'a> Sync for CachedModelRegistry<'a>
impl<'a> Unpin for CachedModelRegistry<'a>
impl<'a> UnsafeUnpin for CachedModelRegistry<'a>
impl<'a> !UnwindSafe for CachedModelRegistry<'a>
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
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 more