pub struct AnthropicProvider { /* private fields */ }Expand description
Anthropic provider implementation. Anthropic provider
Supports the Anthropic Messages API (v1/messages) and Anthropic-compatible providers (MiniMax, etc.) via custom base URLs and extra headers.
Implementations§
Source§impl AnthropicProvider
impl AnthropicProvider
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Anthropic provider without an API key.
API keys are resolved at request time via auth.json or StreamOptions.
Use with_api_key() for explicit key injection.
Sourcepub fn with_api_key(api_key: impl Into<String>) -> Self
pub fn with_api_key(api_key: impl Into<String>) -> Self
Create with an explicit API key.
Sourcepub fn with_base_url(base_url: &str) -> Self
pub fn with_base_url(base_url: &str) -> Self
Create with a custom base URL (for Anthropic-compatible providers like MiniMax that expose the Messages API at a different host).
Note: Anthropic-specific beta headers are NOT included because third-party compatible providers may not support them.
Sourcepub fn with_config(
base_url: &str,
api_key: Option<String>,
extra_headers: Vec<(String, String)>,
) -> Self
pub fn with_config( base_url: &str, api_key: Option<String>, extra_headers: Vec<(String, String)>, ) -> Self
Create with a custom base URL, API key, and extra headers.
Used for registering Anthropic-compatible providers (MiniMax, etc.).
Note: Anthropic-specific beta headers (interleaved-thinking,
fine-grained-tool-streaming) are NOT included here because
third-party compatible providers may not support them, leading
to stream hangs or protocol errors. Use Self::new or
Self::with_api_key for the native Anthropic endpoint which includes
beta headers.
Trait Implementations§
Source§impl Clone for AnthropicProvider
impl Clone for AnthropicProvider
Source§fn clone(&self) -> AnthropicProvider
fn clone(&self) -> AnthropicProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more