pub struct GatewayConfig {
pub base_url: Option<String>,
pub auth_token: Option<String>,
pub custom_headers: Vec<(String, String)>,
pub disable_betas: bool,
}Expand description
LLM Gateway configuration.
Provides a centralized proxy layer between the SDK and model providers, supporting custom endpoints, authentication, and header injection.
Fields§
§base_url: Option<String>Custom base URL (overrides provider URL)
auth_token: Option<String>Custom auth token (overrides provider auth)
custom_headers: Vec<(String, String)>Custom headers (key-value pairs)
disable_betas: boolDisable experimental beta flags for gateway compatibility
Implementations§
Source§impl GatewayConfig
impl GatewayConfig
Sourcepub fn with_base_url(url: impl Into<String>) -> Self
pub fn with_base_url(url: impl Into<String>) -> Self
Create with custom base URL.
Sourcepub fn auth_token(self, token: impl Into<String>) -> Self
pub fn auth_token(self, token: impl Into<String>) -> Self
Set auth token.
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Add a custom header.
Sourcepub fn headers(
self,
headers: impl IntoIterator<Item = (String, String)>,
) -> Self
pub fn headers( self, headers: impl IntoIterator<Item = (String, String)>, ) -> Self
Add multiple headers.
Sourcepub fn disable_betas(self) -> Self
pub fn disable_betas(self) -> Self
Disable experimental beta flags.
Sourcepub fn effective_base_url(&self, default: &str) -> String
pub fn effective_base_url(&self, default: &str) -> String
Get effective base URL.
Sourcepub fn all_headers(&self) -> Vec<(String, String)>
pub fn all_headers(&self) -> Vec<(String, String)>
Get all headers including custom ones.
Trait Implementations§
Source§impl Clone for GatewayConfig
impl Clone for GatewayConfig
Source§fn clone(&self) -> GatewayConfig
fn clone(&self) -> GatewayConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 GatewayConfig
impl Debug for GatewayConfig
Source§impl Default for GatewayConfig
impl Default for GatewayConfig
Source§fn default() -> GatewayConfig
fn default() -> GatewayConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GatewayConfig
impl RefUnwindSafe for GatewayConfig
impl Send for GatewayConfig
impl Sync for GatewayConfig
impl Unpin for GatewayConfig
impl UnwindSafe for GatewayConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.