pub struct AnthropicClientConfig {
pub base_url: Option<String>,
pub default_headers: Vec<(String, String)>,
pub max_retries: Option<u32>,
pub timeout: Option<Duration>,
}Expand description
How the client reaches the Messages 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 ANTHROPIC_BASE_URL, else https://api.anthropic.com.
default_headers: Vec<(String, String)>Headers sent with every request, after those in ANTHROPIC_CUSTOM_HEADERS; a later header
replaces an earlier one with the same name. Pin the API version with
("anthropic-version", "2023-06-01"); betas given as anthropic-beta are kept when the
provider adds its own.
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 AnthropicClientConfig
impl AnthropicClientConfig
Sourcepub fn builder() -> AnthropicClientConfigBuilder
pub fn builder() -> AnthropicClientConfigBuilder
Create an instance of AnthropicClientConfig using the builder syntax
Trait Implementations§
Source§impl Clone for AnthropicClientConfig
impl Clone for AnthropicClientConfig
Source§impl Debug for AnthropicClientConfig
impl Debug for AnthropicClientConfig
Source§impl Default for AnthropicClientConfig
impl Default for AnthropicClientConfig
impl Eq for AnthropicClientConfig
Source§impl PartialEq for AnthropicClientConfig
impl PartialEq for AnthropicClientConfig
impl StructuralPartialEq for AnthropicClientConfig
Auto Trait Implementations§
impl Freeze for AnthropicClientConfig
impl RefUnwindSafe for AnthropicClientConfig
impl Send for AnthropicClientConfig
impl Sync for AnthropicClientConfig
impl Unpin for AnthropicClientConfig
impl UnsafeUnpin for AnthropicClientConfig
impl UnwindSafe for AnthropicClientConfig
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
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
Compare self to
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> ⓘ
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.