Skip to main content

ProviderConfig

Trait ProviderConfig 

Source
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§

Source

fn api_key(&self) -> Option<Cow<'_, str>>

API key or bearer token used to authenticate with the provider.

Provided Methods§

Source

fn base_url(&self) -> Option<Cow<'_, str>>

Optional override for the provider’s base URL.

Source

fn model(&self) -> Option<Cow<'_, str>>

Preferred model identifier for the provider.

Source

fn prompt_cache(&self) -> Option<Cow<'_, PromptCachingConfig>>

Optional prompt cache configuration forwarded to providers that support caching.

Source

fn timeouts(&self) -> Option<Cow<'_, TimeoutsConfig>>

Optional request timeout configuration forwarded to the provider factory.

Source

fn openai(&self) -> Option<Cow<'_, OpenAIConfig>>

Optional OpenAI-specific configuration forwarded to the provider factory.

Source

fn anthropic(&self) -> Option<Cow<'_, AnthropicConfig>>

Optional Anthropic-specific configuration forwarded to the provider factory.

Source

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§

Source§

impl ProviderConfig for OwnedProviderConfig

Source§

impl ProviderConfig for ProviderConfig

ProviderConfig implementation for the concrete factory configuration.