pub trait ProviderConfig {
type PromptCacheSettings: Clone + Default + Send + Sync + 'static;
const PROVIDER_KEY: &'static str;
const DISPLAY_NAME: &'static str;
const DEFAULT_MODEL: &'static str;
const API_BASE_URL: &'static str;
const BASE_URL_ENV_VAR: Option<&'static str>;
// Provided method
fn create_provider(
api_key: String,
model: String,
base_url: String,
prompt_cache_enabled: bool,
prompt_cache_settings: Self::PromptCacheSettings,
timeouts: TimeoutsConfig,
) -> Box<dyn LLMProvider>
where Self::PromptCacheSettings: Send + Sync + 'static { ... }
}Expand description
Trait for provider-specific configuration and creation
Required Associated Constants§
Sourceconst PROVIDER_KEY: &'static str
const PROVIDER_KEY: &'static str
Registry key used to look up this provider in the factory.
Sourceconst DISPLAY_NAME: &'static str
const DISPLAY_NAME: &'static str
Human-readable display name for this provider.
Sourceconst DEFAULT_MODEL: &'static str
const DEFAULT_MODEL: &'static str
Default model identifier when none is specified.
Sourceconst API_BASE_URL: &'static str
const API_BASE_URL: &'static str
Base URL for the provider’s API endpoint.
Sourceconst BASE_URL_ENV_VAR: Option<&'static str>
const BASE_URL_ENV_VAR: Option<&'static str>
Optional environment variable that overrides the base URL.
Required Associated Types§
Provided Methods§
Sourcefn create_provider(
api_key: String,
model: String,
base_url: String,
prompt_cache_enabled: bool,
prompt_cache_settings: Self::PromptCacheSettings,
timeouts: TimeoutsConfig,
) -> Box<dyn LLMProvider>
fn create_provider( api_key: String, model: String, base_url: String, prompt_cache_enabled: bool, prompt_cache_settings: Self::PromptCacheSettings, timeouts: TimeoutsConfig, ) -> Box<dyn LLMProvider>
Construct a boxed LLMProvider from the given configuration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".