pub struct ProviderDef {
pub api_key: Option<String>,
pub base_url: Option<String>,
pub standard: ApiStandard,
pub models: Vec<CompactString>,
}Expand description
Provider definition — credentials and a list of models served.
Each [provider.<name>] in TOML becomes one ProviderDef. The TOML key
is the provider name (not stored in the struct). Multiple models share
the same credentials and endpoint.
Fields§
§api_key: Option<String>API key. Supports ${ENV_VAR} expansion at the daemon layer.
base_url: Option<String>Base URL for the provider endpoint.
standard: ApiStandardAPI protocol standard. Defaults to OpenAI if omitted.
models: Vec<CompactString>Model names served by this provider.
Implementations§
Source§impl ProviderDef
impl ProviderDef
Sourcepub fn effective_standard(&self) -> ApiStandard
pub fn effective_standard(&self) -> ApiStandard
Resolve the effective API standard.
Returns Anthropic if the field is explicitly set to Anthropic,
or if base_url contains “anthropic”. Otherwise OpenAI.
Trait Implementations§
Source§impl Clone for ProviderDef
impl Clone for ProviderDef
Source§fn clone(&self) -> ProviderDef
fn clone(&self) -> ProviderDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderDef
impl Debug for ProviderDef
Source§impl<'de> Deserialize<'de> for ProviderDef
impl<'de> Deserialize<'de> for ProviderDef
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProviderDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProviderDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ProviderDef
impl Serialize for ProviderDef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ProviderDef
impl RefUnwindSafe for ProviderDef
impl Send for ProviderDef
impl Sync for ProviderDef
impl Unpin for ProviderDef
impl UnsafeUnpin for ProviderDef
impl UnwindSafe for ProviderDef
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
Mutably borrows from an owned value. Read more