Skip to main content

ProviderFactory

Trait ProviderFactory 

Source
pub trait ProviderFactory: Send + Sync {
    // Required methods
    fn build(&self, spec: &str) -> Result<Arc<dyn Provider>, CoreError>;
    fn available_providers(&self) -> Vec<String>;
}
Expand description

Factory for building providers from a spec string at runtime.

The spec format is "provider_name" or "provider_name:model".

Required Methods§

Source

fn build(&self, spec: &str) -> Result<Arc<dyn Provider>, CoreError>

Build a new provider from a spec like "anthropic" or "ollama:llama3.2".

Source

fn available_providers(&self) -> Vec<String>

List the available provider names (e.g. ["anthropic", "openai", "ollama", "mock"]).

Implementors§