pub struct ModelProviderCatalog {
factories: BTreeMap<String, RegisteredFactory>,
}Expand description
Catalog of trusted model-provider factories.
Provider names are case-sensitive and first-registration wins: registering an existing name returns an error and leaves the catalog unchanged.
Fields§
§factories: BTreeMap<String, RegisteredFactory>Implementations§
Source§impl ModelProviderCatalog
impl ModelProviderCatalog
pub fn new() -> Self
pub fn with_builtins() -> Result<Self>
pub fn register(&mut self, factory: Arc<dyn ModelProviderFactory>) -> Result<()>
pub fn implementation( &self, provider_name: &str, ) -> Result<&ModelProviderImplementation>
Sourcepub fn validate_config(
&self,
models: &BTreeMap<String, ModelDefinition>,
) -> Result<()>
pub fn validate_config( &self, models: &BTreeMap<String, ModelDefinition>, ) -> Result<()>
Validate definitions without constructing providers or resolving secrets.
pub(crate) fn validate_definition( &self, alias: &str, definition: &ModelDefinition, ) -> Result<()>
pub(crate) fn build( &self, alias: &str, definition: &ModelDefinition, ) -> Result<(Arc<dyn ModelProvider>, ModelProviderImplementation)>
Trait Implementations§
Source§impl Clone for ModelProviderCatalog
impl Clone for ModelProviderCatalog
Source§fn clone(&self) -> ModelProviderCatalog
fn clone(&self) -> ModelProviderCatalog
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 Default for ModelProviderCatalog
impl Default for ModelProviderCatalog
Source§fn default() -> ModelProviderCatalog
fn default() -> ModelProviderCatalog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ModelProviderCatalog
impl !UnwindSafe for ModelProviderCatalog
impl Freeze for ModelProviderCatalog
impl Send for ModelProviderCatalog
impl Sync for ModelProviderCatalog
impl Unpin for ModelProviderCatalog
impl UnsafeUnpin for ModelProviderCatalog
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreimpl<T> MaybeSend for Twhere
T: Send,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt 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().