pub trait ProviderConfig {
// Required method
fn api_key(&self) -> Option<Cow<'_, str>>;
// Provided methods
fn base_url(&self) -> Option<Cow<'_, str>> { ... }
fn model(&self) -> Option<Cow<'_, str>> { ... }
fn prompt_cache(&self) -> Option<Cow<'_, PromptCachingConfig>> { ... }
fn timeouts(&self) -> Option<Cow<'_, TimeoutsConfig>> { ... }
fn openai(&self) -> Option<Cow<'_, OpenAIConfig>> { ... }
fn anthropic(&self) -> Option<Cow<'_, AnthropicConfig>> { ... }
fn model_behavior(&self) -> Option<Cow<'_, ModelConfig>> { ... }
}Expand description
Trait describing the configuration required to instantiate an LLM provider.
The trait intentionally returns owned-friendly values so that consumers can
back the configuration with environment variables, secret managers, or
custom structs. The as_factory_config helper converts a trait object into
the concrete configuration type expected by vtcode_core’s provider
factory.
Required Methods§
Provided Methods§
Sourcefn prompt_cache(&self) -> Option<Cow<'_, PromptCachingConfig>>
fn prompt_cache(&self) -> Option<Cow<'_, PromptCachingConfig>>
Optional prompt cache configuration forwarded to providers that support caching.
Sourcefn timeouts(&self) -> Option<Cow<'_, TimeoutsConfig>>
fn timeouts(&self) -> Option<Cow<'_, TimeoutsConfig>>
Optional request timeout configuration forwarded to the provider factory.
Sourcefn openai(&self) -> Option<Cow<'_, OpenAIConfig>>
fn openai(&self) -> Option<Cow<'_, OpenAIConfig>>
Optional OpenAI-specific configuration forwarded to the provider factory.
Sourcefn anthropic(&self) -> Option<Cow<'_, AnthropicConfig>>
fn anthropic(&self) -> Option<Cow<'_, AnthropicConfig>>
Optional Anthropic-specific configuration forwarded to the provider factory.
Sourcefn model_behavior(&self) -> Option<Cow<'_, ModelConfig>>
fn model_behavior(&self) -> Option<Cow<'_, ModelConfig>>
Optional model behavior configuration (loop detection, capability overrides).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl ProviderConfig for OwnedProviderConfig
impl ProviderConfig for ProviderConfig
ProviderConfig implementation for the concrete factory configuration.