pub struct ProviderCreds {
pub name: String,
pub api_key: Option<String>,
pub base_url: Option<String>,
pub model_capabilities: HashMap<String, ModelCapabilities>,
pub request_timeout_secs: Option<u64>,
pub rate_limit: Option<RateLimitConfig>,
pub options: HashMap<String, String>,
}Expand description
Decoupled provider credentials.
Plain data so build_provider_registry can instantiate providers without
depending on the CLI’s Config/ProviderConfig types. Build one per
provider that should be registered.
Debug is hand-written (below) so api_key cannot be printed.
Fields§
§name: StringProvider identifier: anthropic | openai | google | openrouter |
ollama | claude-code. Selects which provider is instantiated.
api_key: Option<String>API key, when the provider needs one (None for ollama/claude-code).
base_url: Option<String>Base URL override (used by ollama; None uses the built-in default).
model_capabilities: HashMap<String, ModelCapabilities>Per-model capability overrides forwarded to the provider.
request_timeout_secs: Option<u64>HTTP request timeout in seconds (None uses the provider default).
rate_limit: Option<RateLimitConfig>Client-side rate limit (requests/tokens per minute) enforced before
each call. None sends requests unthrottled. Ignored by ollama
(a local server) and claude-code (a subprocess).
options: HashMap<String, String>Provider-specific settings that don’t fit the api-key / base-URL shape.
Currently only claude-code reads this, for binary (path to the
claude executable) and effort (reasoning level). Kept as a map rather
than named fields so one provider’s options don’t accrete onto a struct
shared by six.
Implementations§
Trait Implementations§
Source§impl Clone for ProviderCreds
impl Clone for ProviderCreds
Source§fn clone(&self) -> ProviderCreds
fn clone(&self) -> ProviderCreds
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderCreds
Hand-written so the API key can never reach a log line.
impl Debug for ProviderCreds
Hand-written so the API key can never reach a log line.
A #[derive(Debug)] here meant a single tracing::debug!(?creds) - or an
error context that formats a struct holding one - would print the key.
Nothing did, which is when it is cheap to make impossible.
Auto Trait Implementations§
impl Freeze for ProviderCreds
impl RefUnwindSafe for ProviderCreds
impl Send for ProviderCreds
impl Sync for ProviderCreds
impl Unpin for ProviderCreds
impl UnsafeUnpin for ProviderCreds
impl UnwindSafe for ProviderCreds
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> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.