Skip to main content

ProviderConfig

Trait ProviderConfig 

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

Source

const PROVIDER_KEY: &'static str

Registry key used to look up this provider in the factory.

Source

const DISPLAY_NAME: &'static str

Human-readable display name for this provider.

Source

const DEFAULT_MODEL: &'static str

Default model identifier when none is specified.

Source

const API_BASE_URL: &'static str

Base URL for the provider’s API endpoint.

Source

const BASE_URL_ENV_VAR: Option<&'static str>

Optional environment variable that overrides the base URL.

Required Associated Types§

Source

type PromptCacheSettings: Clone + Default + Send + Sync + 'static

Provider-specific prompt cache configuration type.

Provided Methods§

Source

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,

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".

Implementors§

Source§

impl ProviderConfig for AnthropicProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for CopilotProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for DeepSeekProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for EvolinkProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for GeminiProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = GeminiPromptCacheSettings

Source§

impl ProviderConfig for HuggingFaceProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for LlamaCppProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for LmStudioProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for MergeGatewayProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for MetaProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for MiMoProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for MinimaxProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for MistralProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for MoonshotProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for NvidiaProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for OllamaCloudProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for OllamaProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for OpenAIProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for OpenCodeGoProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for OpenCodeZenProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for OpenResponsesProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for OpenRouterProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for PoolsideProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for QwenProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for StepFunProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for VercelProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for XAIProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()

Source§

impl ProviderConfig for ZAIProviderConfig

Source§

const PROVIDER_KEY: &'static str = <Self as CanDescribeProvider>::PROVIDER_KEY

Source§

const DISPLAY_NAME: &'static str = <Self as CanDescribeProvider>::DISPLAY_NAME

Source§

const DEFAULT_MODEL: &'static str = <Self as CanDescribeProvider>::DEFAULT_MODEL

Source§

const API_BASE_URL: &'static str = <Self as CanDescribeProvider>::API_BASE_URL

Source§

const BASE_URL_ENV_VAR: Option<&'static str> = <Self as CanDescribeProvider>::BASE_URL_ENV_VAR

Source§

type PromptCacheSettings = ()