pub struct ClientBuilder<'a> { /* private fields */ }
Implementations§
Source§impl<'a> ClientBuilder<'a>
Create a new anthropic client using the builder
impl<'a> ClientBuilder<'a>
Create a new anthropic client using the builder
§Example
use rig::providers::anthropic::{ClientBuilder, self};
// Initialize the Anthropic client
let anthropic_client = ClientBuilder::new("your-claude-api-key")
.anthropic_version(ANTHROPIC_VERSION_LATEST)
.anthropic_beta("prompt-caching-2024-07-31")
.build()
pub fn new(api_key: &'a str) -> Self
pub fn base_url(self, base_url: &'a str) -> Self
pub fn anthropic_version(self, anthropic_version: &'a str) -> Self
pub fn anthropic_beta(self, anthropic_beta: &'a str) -> Self
pub fn custom_client(self, client: Client) -> Self
pub fn build(self) -> Result<Client, ClientBuilderError>
Auto Trait Implementations§
impl<'a> Freeze for ClientBuilder<'a>
impl<'a> !RefUnwindSafe for ClientBuilder<'a>
impl<'a> Send for ClientBuilder<'a>
impl<'a> Sync for ClientBuilder<'a>
impl<'a> Unpin for ClientBuilder<'a>
impl<'a> !UnwindSafe for ClientBuilder<'a>
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> 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 more