pub struct InMemoryProviderStore { /* private fields */ }Expand description
Application-grade in-memory provider store for embedded hosts.
Implementations§
Source§impl InMemoryProviderStore
impl InMemoryProviderStore
Sourcepub async fn from_credential_provider(provider: &dyn CredentialProvider) -> Self
pub async fn from_credential_provider(provider: &dyn CredentialProvider) -> Self
Configure a default model from explicitly injected credentials.
Sourcepub async fn with_default(model: ModelSpec) -> Self
pub async fn with_default(model: ModelSpec) -> Self
Create a provider store with one default model.
Sourcepub async fn add_model(&self, model_id: ModelId, model: ModelSpec)
pub async fn add_model(&self, model_id: ModelId, model: ModelSpec)
Insert or replace a model by id.
Sourcepub async fn set_default_model_spec(&self, model: ModelSpec)
pub async fn set_default_model_spec(&self, model: ModelSpec)
Set the default model used when a session has no explicit model id.
Sourcepub async fn set_provider_config(&self, config: ProviderConfig)
pub async fn set_provider_config(&self, config: ProviderConfig)
Set credential-bearing construction material independently from model identity.
Trait Implementations§
Source§impl Clone for InMemoryProviderStore
impl Clone for InMemoryProviderStore
Source§fn clone(&self) -> InMemoryProviderStore
fn clone(&self) -> InMemoryProviderStore
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 InMemoryProviderStore
impl Debug for InMemoryProviderStore
Source§impl Default for InMemoryProviderStore
impl Default for InMemoryProviderStore
Source§fn default() -> InMemoryProviderStore
fn default() -> InMemoryProviderStore
Returns the “default value” for a type. Read more
Source§impl ProviderStore for InMemoryProviderStore
impl ProviderStore for InMemoryProviderStore
Source§fn get_model_spec<'life0, 'async_trait>(
&'life0 self,
model_id: ModelId,
) -> Pin<Box<dyn Future<Output = Result<Option<ModelSpec>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_model_spec<'life0, 'async_trait>(
&'life0 self,
model_id: ModelId,
) -> Pin<Box<dyn Future<Output = Result<Option<ModelSpec>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolve a configured model ID to its credential-free model selection.
Source§fn get_default_model_spec<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ModelSpec>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_default_model_spec<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ModelSpec>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the default credential-free model selection.
Source§fn get_provider_config<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 ProviderKey,
) -> Pin<Box<dyn Future<Output = Result<Option<ProviderConfig>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_provider_config<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 ProviderKey,
) -> Pin<Box<dyn Future<Output = Result<Option<ProviderConfig>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve runtime service configuration independently from the model. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryProviderStore
impl !UnwindSafe for InMemoryProviderStore
impl Freeze for InMemoryProviderStore
impl Send for InMemoryProviderStore
impl Sync for InMemoryProviderStore
impl Unpin for InMemoryProviderStore
impl UnsafeUnpin for InMemoryProviderStore
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