Struct AnthropicBuilder
pub struct AnthropicBuilder { /* private fields */ }Expand description
Typed builder for AnthropicModelProvider.
alias is the only positional argument. Everything else has a
sensible default: the base URL falls back to Anthropic’s published
endpoint, no credential leaves the provider unauthenticated (fine
for local mocks), and token/timeout limits use the workspace baselines.
Implementations§
Source§impl AnthropicBuilder
impl AnthropicBuilder
Sourcepub fn credential(self, credential: Option<&str>) -> Self
pub fn credential(self, credential: Option<&str>) -> Self
Explicit API credential. Whitespace-only inputs are normalized
to None so a stray Some(" ") from config cannot produce a
bogus Bearer header.
Sourcepub fn base_url(self, base_url: &str) -> Self
pub fn base_url(self, base_url: &str) -> Self
Override the API endpoint. Trailing slashes are stripped so callers need not care whether config supplied them.
Sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Override the maximum output tokens for API requests. Defaults to
zeroclaw_api::model_provider::BASELINE_MAX_TOKENS when unset.
Sourcepub fn timeout_secs(self, timeout_secs: u64) -> Self
pub fn timeout_secs(self, timeout_secs: u64) -> Self
Override the HTTP request timeout for LLM API calls. Defaults to
zeroclaw_api::model_provider::BASELINE_TIMEOUT_SECS when unset.
pub fn build(self) -> AnthropicModelProvider
Auto Trait Implementations§
impl Freeze for AnthropicBuilder
impl RefUnwindSafe for AnthropicBuilder
impl Send for AnthropicBuilder
impl Sync for AnthropicBuilder
impl Unpin for AnthropicBuilder
impl UnsafeUnpin for AnthropicBuilder
impl UnwindSafe for AnthropicBuilder
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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