pub enum AnyProvider {
Ollama(OllamaProvider),
OpenAiCompat(OpenAiCompatProvider),
Sockudo(SockudoProvider),
}Expand description
Concrete wrapper over all built-in provider backends.
The Provider trait is not dyn-compatible (its async methods use
RPITIT return types), so dynamic dispatch over a runtime-selected
backend goes through this enum instead of Arc<Mutex<dyn Provider>>.
Commands and the agent loop share an Arc<Mutex<AnyProvider>>.
Variants§
Implementations§
Source§impl AnyProvider
impl AnyProvider
Sourcepub fn build(
kind: ProviderKind,
base_url: String,
api_key: Option<SecretString>,
timeout_secs: u64,
max_retries: u32,
think_type: OllamaThinkType,
sockudo: SockudoCredentials,
) -> Result<Self, String>
pub fn build( kind: ProviderKind, base_url: String, api_key: Option<SecretString>, timeout_secs: u64, max_retries: u32, think_type: OllamaThinkType, sockudo: SockudoCredentials, ) -> Result<Self, String>
Build the provider for kind from resolved settings values.
url and credentials come from the caller (CLI flags / settings);
timeout_secs/max_retries are the effective per-provider values
from Settings::effective_timeout_secs()/effective_max_retries().
Sourcepub fn kind(&self) -> ProviderKind
pub fn kind(&self) -> ProviderKind
The provider kind this instance wraps.
Note: LlamaCpp/Vllm are both backed by OpenAiCompatProvider,
so kind() cannot distinguish them — it reports OpenAiCompat for
both. Use build()’s input ProviderKind where the exact kind
matters.
Trait Implementations§
Source§impl Provider for AnyProvider
impl Provider for AnyProvider
Source§async fn health_check(&self) -> Result<(), String>
async fn health_check(&self) -> Result<(), String>
Source§async fn list_models(&self) -> Vec<String>
async fn list_models(&self) -> Vec<String>
Source§fn select_model(&mut self, name: String)
fn select_model(&mut self, name: String)
Provider::chat requests.