Skip to main content

ProviderFactory

Trait ProviderFactory 

Source
pub trait ProviderFactory: Sized {
    // Required methods
    fn from_env() -> Result<Self>;
    fn with_model(self, model: &str) -> Self;
}
Expand description

Factory trait for constructing model providers

This trait is separate from StreamingModelProvider to allow trait objects (Box) to work without construction methods.

Required Methods§

Source

fn from_env() -> Result<Self>

Create provider from environment variables and default configuration

Source

fn with_model(self, model: &str) -> Self

Set or update the model for this provider (builder pattern)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§