Skip to main content

ModelProviderFactory

Trait ModelProviderFactory 

Source
pub trait ModelProviderFactory: Send + Sync {
    // Required methods
    fn provider_name(&self) -> &str;
    fn implementation(&self) -> ModelProviderImplementation;
    fn validate(&self, definition: &ModelDefinition) -> Result<()>;
    fn build(
        &self,
        definition: &ModelDefinition,
    ) -> Result<Arc<dyn ModelProvider>>;
}
Expand description

A compiled, trusted provider factory registered explicitly by the host.

Required Methods§

Source

fn provider_name(&self) -> &str

Configuration name used by ModelDefinition::provider.

Source

fn implementation(&self) -> ModelProviderImplementation

Stable, non-secret adapter identity and compatibility version.

Source

fn validate(&self, definition: &ModelDefinition) -> Result<()>

Validate provider-specific configuration without side effects.

Source

fn build(&self, definition: &ModelDefinition) -> Result<Arc<dyn ModelProvider>>

Construct the provider for runtime execution.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§