#[non_exhaustive]pub struct NamedProviderConfig {
pub name: String,
pub provider_type: Option<String>,
pub wire_api: Option<String>,
pub base_url: String,
pub api_key: Option<String>,
pub bearer_token: Option<String>,
pub azure: Option<AzureProviderOptions>,
pub headers: Option<HashMap<String, String>>,
}Expand description
A named BYOK provider connection in the multi-provider registry.
Experimental. Multi-provider BYOK configuration is part of an experimental surface and may change or be removed in a future release.
Unlike ProviderConfig, which routes the whole session through a
single provider, named providers are additive: the session keeps its
default Copilot routing and exposes these providers’ models alongside
it. Models are attached via ProviderModelConfig, which references a
provider by name.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringUnique name used by ProviderModelConfig::provider to reference
this connection.
provider_type: Option<String>Provider type: "openai", "azure", or "anthropic". Defaults to
"openai" on the CLI.
wire_api: Option<String>API format (openai/azure only): "completions" or "responses".
Defaults to "completions".
base_url: StringAPI endpoint URL.
api_key: Option<String>API key. Optional for local providers like Ollama.
bearer_token: Option<String>Bearer token for authentication. Sets the Authorization header
directly. Takes precedence over api_key when both are set.
azure: Option<AzureProviderOptions>Azure-specific options.
headers: Option<HashMap<String, String>>Custom HTTP headers included in outbound provider requests.
Implementations§
Source§impl NamedProviderConfig
impl NamedProviderConfig
Sourcepub fn new(name: impl Into<String>, base_url: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, base_url: impl Into<String>) -> Self
Construct a NamedProviderConfig with the required name and
base_url set; all other fields default to unset.
Sourcepub fn with_provider_type(self, provider_type: impl Into<String>) -> Self
pub fn with_provider_type(self, provider_type: impl Into<String>) -> Self
Set the provider type ("openai", "azure", or "anthropic").
Sourcepub fn with_wire_api(self, wire_api: impl Into<String>) -> Self
pub fn with_wire_api(self, wire_api: impl Into<String>) -> Self
Set the API format ("completions" or "responses"; openai/azure only).
Sourcepub fn with_api_key(self, api_key: impl Into<String>) -> Self
pub fn with_api_key(self, api_key: impl Into<String>) -> Self
Set the API key. Optional for local providers like Ollama.
Sourcepub fn with_bearer_token(self, bearer_token: impl Into<String>) -> Self
pub fn with_bearer_token(self, bearer_token: impl Into<String>) -> Self
Set the bearer token used to populate the Authorization header.
Takes precedence over api_key when both are set.
Sourcepub fn with_azure(self, azure: AzureProviderOptions) -> Self
pub fn with_azure(self, azure: AzureProviderOptions) -> Self
Set Azure-specific options.
Sourcepub fn with_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_headers(self, headers: HashMap<String, String>) -> Self
Set the custom HTTP headers attached to outbound provider requests.
Trait Implementations§
Source§impl Clone for NamedProviderConfig
impl Clone for NamedProviderConfig
Source§fn clone(&self) -> NamedProviderConfig
fn clone(&self) -> NamedProviderConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more