pub struct UserProviderConfig {
pub base_url: Option<String>,
pub api_key_env: Option<String>,
pub extra_headers: HashMap<String, String>,
pub compat: Option<String>,
pub default_model: Option<String>,
}Expand description
User-supplied OpenAI-compatible provider configuration. All fields are
optional — when matching a built-in registry entry, only the supplied
fields override; the rest fall back to the registry defaults. For
fully custom providers, base_url and api_key_env are required.
Fields§
§base_url: Option<String>Override base URL for /chat/completions (None = use built-in
registry 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.
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
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