pub struct OpenAIClientConfig {
pub base_url: Option<String>,
pub organization: Option<String>,
pub project: Option<String>,
pub default_headers: Vec<(String, String)>,
pub max_retries: Option<u32>,
pub timeout: Option<Duration>,
}Expand description
How the client reaches the OpenAI API.
Debug redacts the values of credential headers (authorization, proxy-authorization,
x-api-key, api-key, cookie).
Fields§
§base_url: Option<String>The API base URL. Defaults to OPENAI_BASE_URL, else https://api.openai.com/v1.
organization: Option<String>The OpenAI-Organization header. Defaults to OPENAI_ORG_ID.
project: Option<String>The OpenAI-Project header. Defaults to OPENAI_PROJECT_ID.
default_headers: Vec<(String, String)>Headers sent with every request, after those in OPENAI_CUSTOM_HEADERS; a later header
replaces an earlier one with the same name, and these replace the provider’s own,
Authorization included.
max_retries: Option<u32>Retries on connection errors, timeouts, 408, 409, 429 and 5xx responses. Default 2.
timeout: Option<Duration>Time each attempt may wait for the response headers. Default 10 minutes.
Implementations§
Source§impl OpenAIClientConfig
impl OpenAIClientConfig
Sourcepub fn builder() -> OpenAIClientConfigBuilder
pub fn builder() -> OpenAIClientConfigBuilder
Create an instance of OpenAIClientConfig using the builder syntax
Trait Implementations§
Source§impl Clone for OpenAIClientConfig
impl Clone for OpenAIClientConfig
Source§impl Debug for OpenAIClientConfig
impl Debug for OpenAIClientConfig
Source§impl Default for OpenAIClientConfig
impl Default for OpenAIClientConfig
impl Eq for OpenAIClientConfig
Source§impl PartialEq for OpenAIClientConfig
impl PartialEq for OpenAIClientConfig
impl StructuralPartialEq for OpenAIClientConfig
Auto Trait Implementations§
impl Freeze for OpenAIClientConfig
impl RefUnwindSafe for OpenAIClientConfig
impl Send for OpenAIClientConfig
impl Sync for OpenAIClientConfig
impl Unpin for OpenAIClientConfig
impl UnsafeUnpin for OpenAIClientConfig
impl UnwindSafe for OpenAIClientConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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