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§
Sourcefn build(&self, spec: &str) -> Result<Arc<dyn Provider>, CoreError>
fn build(&self, spec: &str) -> Result<Arc<dyn Provider>, CoreError>
Build a new provider from a spec like "anthropic" or "ollama:llama3.2".
Sourcefn available_providers(&self) -> Vec<String>
fn available_providers(&self) -> Vec<String>
List the available provider names (e.g. ["anthropic", "openai", "ollama", "mock"]).