pub struct ProviderChoice {
pub provider: BuiltinProvider,
pub api_key: String,
pub source_var: Option<&'static str>,
pub base_url: Option<String>,
}Expand description
A provider together with the key it will authenticate with.
Fields§
§provider: BuiltinProvider§api_key: String§source_var: Option<&'static str>The variable the key came from, or None when it was passed directly.
base_url: Option<String>Set when the model lives behind an OpenAI-compatible endpoint rather
than the provider’s own service. Already normalized by
normalize_base_url.
Implementations§
Source§impl ProviderChoice
impl ProviderChoice
Sourcepub fn is_compatible_endpoint(&self) -> bool
pub fn is_compatible_endpoint(&self) -> bool
Whether this choice points at a custom OpenAI-compatible endpoint.
Trait Implementations§
Source§impl Clone for ProviderChoice
impl Clone for ProviderChoice
Source§fn clone(&self) -> ProviderChoice
fn clone(&self) -> ProviderChoice
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProviderChoice
Hand-written so a resolved credential cannot reach a log — or a panicking
test’s output — through a {:?}. This is the struct an expect on a
resolution prints, and the field is a key basis has just read out of the
environment, in plain text. Everything else is printed as it is, including
source_var: naming the variable a key came from is how a caller debugs
which one won, and it says nothing about the value.
impl Debug for ProviderChoice
Hand-written so a resolved credential cannot reach a log — or a panicking
test’s output — through a {:?}. This is the struct an expect on a
resolution prints, and the field is a key basis has just read out of the
environment, in plain text. Everything else is printed as it is, including
source_var: naming the variable a key came from is how a caller debugs
which one won, and it says nothing about the value.
Auto Trait Implementations§
impl Freeze for ProviderChoice
impl RefUnwindSafe for ProviderChoice
impl Send for ProviderChoice
impl Sync for ProviderChoice
impl Unpin for ProviderChoice
impl UnsafeUnpin for ProviderChoice
impl UnwindSafe for ProviderChoice
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