Skip to main content

ProviderBuilder

Trait ProviderBuilder 

Source
pub trait ProviderBuilder: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn create(&self, config: &Config) -> Result<Box<dyn AIProvider>>;

    // Provided methods
    fn aliases(&self) -> Vec<&'static str> { ... }
    fn category(&self) -> ProviderCategory { ... }
    fn requires_api_key(&self) -> bool { ... }
    fn default_model(&self) -> Option<&'static str> { ... }
}
Expand description

Trait for building AI provider instances

Required Methods§

Source

fn name(&self) -> &'static str

The provider name/identifier

Source

fn create(&self, config: &Config) -> Result<Box<dyn AIProvider>>

Create a provider instance from config

Provided Methods§

Source

fn aliases(&self) -> Vec<&'static str>

Alternative names for this provider (aliases)

Source

fn category(&self) -> ProviderCategory

Provider category for documentation

Source

fn requires_api_key(&self) -> bool

Whether this provider requires an API key

Source

fn default_model(&self) -> Option<&'static str>

Default model for this provider (if applicable)

Implementors§