pub struct CustomProviderConfig {
pub name: String,
pub display_name: String,
pub base_url: String,
pub api_key_env: String,
pub model: String,
}Expand description
Configuration for a user-defined OpenAI-compatible provider endpoint.
Allows users to define multiple named custom endpoints (e.g., corporate proxies) with distinct display names, so they can toggle between them and clearly see which endpoint is active.
Fields§
§name: StringStable provider key used for routing and persistence (e.g., “mycorp”). Must be lowercase alphanumeric with optional hyphens/underscores.
display_name: StringHuman-friendly label shown in the TUI header, footer, and model picker (e.g., “MyCorporateName”).
base_url: StringBase URL of the OpenAI-compatible API endpoint (e.g., “https://llm.corp.example/v1”).
api_key_env: StringEnvironment variable name that holds the API key for this endpoint (e.g., “MYCORP_API_KEY”).
model: StringDefault model to use with this endpoint (e.g., “gpt-5-mini”).
Implementations§
Source§impl CustomProviderConfig
impl CustomProviderConfig
Sourcepub fn resolved_api_key_env(&self) -> String
pub fn resolved_api_key_env(&self) -> String
Resolve the API key environment variable used for this provider.
Falls back to a derived NAME_API_KEY-style variable when the config
does not set api_key_env.
Trait Implementations§
Source§impl Clone for CustomProviderConfig
impl Clone for CustomProviderConfig
Source§fn clone(&self) -> CustomProviderConfig
fn clone(&self) -> CustomProviderConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CustomProviderConfig
impl Debug for CustomProviderConfig
Source§impl<'de> Deserialize<'de> for CustomProviderConfig
impl<'de> Deserialize<'de> for CustomProviderConfig
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>,
Source§impl JsonSchema for CustomProviderConfig
impl JsonSchema for CustomProviderConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for CustomProviderConfig
impl RefUnwindSafe for CustomProviderConfig
impl Send for CustomProviderConfig
impl Sync for CustomProviderConfig
impl Unpin for CustomProviderConfig
impl UnsafeUnpin for CustomProviderConfig
impl UnwindSafe for CustomProviderConfig
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,
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