pub struct UserProviderConfig {
pub base_url: Option<String>,
pub api_key_env: Option<String>,
pub extra_headers: HashMap<String, String>,
pub env_headers: HashMap<String, String>,
pub compat: Option<String>,
pub default_model: Option<String>,
}Expand description
User-supplied remote provider configuration. All fields are optional for a built-in provider; fully custom OpenAI-compatible providers require a base URL and API-key environment variable.
Fields§
§base_url: Option<String>Override the provider API base URL (None = built-in default; required for fully custom providers).
api_key_env: Option<String>Env var name to read the API key from (None = use the built-in
registry default like GROQ_API_KEY; required for fully custom
providers).
extra_headers: HashMap<String, String>Extra HTTP headers sent on every request to this provider.
env_headers: HashMap<String, String>Extra HTTP headers whose VALUES come from environment variables (map is header name -> env var name), resolved at request-build time so a secret header (e.g. a gateway token) never has to live in config.toml. A missing env var is skipped.
compat: Option<String>For fully custom providers (no built-in registry entry), declares
which OpenAI-compatible shape the endpoint speaks. Ignored when
the provider name matches a built-in registry entry. Values:
"openai" (no reasoning), "openai-effort" (reasoning_effort
field), "openrouter" (nested reasoning: {effort} object).
default_model: Option<String>Optional preferred model — surfaced by mermaid status and used
as the default when the user picks this provider with no model
suffix.
Trait Implementations§
Source§impl Clone for UserProviderConfig
impl Clone for UserProviderConfig
Source§fn clone(&self) -> UserProviderConfig
fn clone(&self) -> UserProviderConfig
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 UserProviderConfig
impl Debug for UserProviderConfig
Source§impl Default for UserProviderConfig
impl Default for UserProviderConfig
Source§fn default() -> UserProviderConfig
fn default() -> UserProviderConfig
Source§impl<'de> Deserialize<'de> for UserProviderConfig
impl<'de> Deserialize<'de> for UserProviderConfig
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>,
Auto Trait Implementations§
impl Freeze for UserProviderConfig
impl RefUnwindSafe for UserProviderConfig
impl Send for UserProviderConfig
impl Sync for UserProviderConfig
impl Unpin for UserProviderConfig
impl UnsafeUnpin for UserProviderConfig
impl UnwindSafe for UserProviderConfig
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> 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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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