pub struct AnthropicProvider { /* private fields */ }Expand description
Anthropic Messages API client. Stateless — one struct, many
complete() calls. The agent (ureq client) is reused across
calls so connection-pool / TLS-session-cache benefits accrue
when the same AnthropicProvider makes repeat calls.
Implementations§
Source§impl AnthropicProvider
impl AnthropicProvider
Sourcepub fn new(api_key: impl Into<String>) -> AnthropicProvider
pub fn new(api_key: impl Into<String>) -> AnthropicProvider
Build a provider with the API key and the production endpoint.
Sourcepub fn with_base_url(
api_key: impl Into<String>,
base_url: impl Into<String>,
) -> AnthropicProvider
pub fn with_base_url( api_key: impl Into<String>, base_url: impl Into<String>, ) -> AnthropicProvider
Build a provider pointing at an alternative base URL. The test suite uses this to point at a localhost mock; users could also use it for a corporate proxy or a regional Anthropic endpoint when those become available.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnthropicProvider
impl !RefUnwindSafe for AnthropicProvider
impl Send for AnthropicProvider
impl Sync for AnthropicProvider
impl Unpin for AnthropicProvider
impl UnsafeUnpin for AnthropicProvider
impl !UnwindSafe for AnthropicProvider
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