pub enum ProviderConfig {
OpenAi(OpenAIConfig),
Anthropic(AnthropicConfig),
Gemini(GeminiConfig),
}Expand description
A provider configuration tagged by protocol family, such as {"openai": {…}}.
Serialization rejects unregistered or modified dialect definitions. Set
persistent hosts and typed options on the configuration, not the dialect.
Deserialization reports unknown configuration fields by name.
Variants§
OpenAi(OpenAIConfig)
An OpenAI-shaped provider, on either of its two endpoints.
Anthropic(AnthropicConfig)
A Messages-format provider.
Gemini(GeminiConfig)
Gemini.
Implementations§
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn id(&self) -> Option<ProviderId>
pub fn id(&self) -> Option<ProviderId>
The catalog selection with this dialect’s name, if registered. Host and option overrides do not change the selection; its preset remains the catalog’s, never a custom dialect’s payload.
Sourcepub fn vendor(&self) -> &'static str
pub fn vendor(&self) -> &'static str
The configured dialect’s name, including unregistered dialects.
Sourcepub fn is_unauthenticated(&self) -> bool
pub fn is_unauthenticated(&self) -> bool
Whether the credential is empty, as it is after serialization round-trip
because Secret omits its value.
Sourcepub fn with_credential(self, api_key: impl Into<Secret>) -> Self
pub fn with_credential(self, api_key: impl Into<Secret>) -> Self
The same configuration with api_key as its credential: how a host
rehydrates a configuration it loaded from data.
Sourcepub fn completion_handler(
&self,
label: &str,
model: &str,
http: DynHttpClient,
) -> ErasedHandler
pub fn completion_handler( &self, label: &str, model: &str, http: DynHttpClient, ) -> ErasedHandler
The completion wire for model, bound to http, erased behind a
ModelAdapter labelled label.
A handler built from data uses the provider’s own completion wire, including Copilot’s model-dependent routing and request envelope. Explicit hosts, routes and typed options are preserved.
Trait Implementations§
Source§impl Clone for ProviderConfig
impl Clone for ProviderConfig
Source§impl Debug for ProviderConfig
impl Debug for ProviderConfig
Source§impl<'de> Deserialize<'de> for ProviderConfig
impl<'de> Deserialize<'de> for ProviderConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ProviderConfig
impl PartialEq for ProviderConfig
Source§impl Serialize for ProviderConfig
impl Serialize for ProviderConfig
impl StructuralPartialEq for ProviderConfig
Auto Trait Implementations§
impl Freeze for ProviderConfig
impl RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl UnsafeUnpin for ProviderConfig
impl UnwindSafe for ProviderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more