pub struct AnthropicCompatibleClient { /* private fields */ }
Expand description
A client for making requests to an OpenAI compatible API.
Implementations§
Source§impl AnthropicCompatibleClient
impl AnthropicCompatibleClient
Sourcepub fn with_api_key(self, api_key: impl ToString) -> Self
pub fn with_api_key(self, api_key: impl ToString) -> Self
Sets the API key for the builder. (defaults to the environment variable ANTHROPIC_API_KEY
)
The API key can be accessed from the Anthropic dashboard here.
Sourcepub fn with_base_url(self, base_url: impl ToString) -> Self
pub fn with_base_url(self, base_url: impl ToString) -> Self
Set the base URL of the API. (defaults to https://api.anthropic.com/v1/
)
Sourcepub fn with_anthropic_version(self, version: impl ToString) -> Self
pub fn with_anthropic_version(self, version: impl ToString) -> Self
Set the anthropic version you are using.
Defaults to `2023-06-01``
Sourcepub fn with_reqwest_client(self, client: Client) -> Self
pub fn with_reqwest_client(self, client: Client) -> Self
Set the reqwest client for the builder.
Sourcepub fn resolve_api_key(&self) -> Result<String, NoAnthropicAPIKeyError>
pub fn resolve_api_key(&self) -> Result<String, NoAnthropicAPIKeyError>
Resolve the anthropic API key from the environment variable ANTHROPIC_API_KEY
or the provided api key.
Trait Implementations§
Source§impl Clone for AnthropicCompatibleClient
impl Clone for AnthropicCompatibleClient
Source§fn clone(&self) -> AnthropicCompatibleClient
fn clone(&self) -> AnthropicCompatibleClient
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AnthropicCompatibleClient
impl Debug for AnthropicCompatibleClient
Auto Trait Implementations§
impl !Freeze for AnthropicCompatibleClient
impl !RefUnwindSafe for AnthropicCompatibleClient
impl Send for AnthropicCompatibleClient
impl Sync for AnthropicCompatibleClient
impl Unpin for AnthropicCompatibleClient
impl !UnwindSafe for AnthropicCompatibleClient
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