pub struct AnthropicProvider { /* private fields */ }
Expand description
Anthropic provider implementation
Implementations§
Source§impl AnthropicProvider
impl AnthropicProvider
Sourcepub fn new(config: LLMProviderConfig) -> LLMResult<Self>
pub fn new(config: LLMProviderConfig) -> LLMResult<Self>
Create new Anthropic provider
Trait Implementations§
Source§impl Debug for AnthropicProvider
impl Debug for AnthropicProvider
Source§impl LLMProvider for AnthropicProvider
impl LLMProvider for AnthropicProvider
Source§fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<LLMResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<LLMResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a response for the given request Read more
Source§fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<Vec<ModelInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<Vec<ModelInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List available models for this provider
Source§fn capabilities(&self) -> &LLMCapabilities
fn capabilities(&self) -> &LLMCapabilities
Get provider capabilities
Source§fn get_model_info<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = LLMResult<ModelInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_model_info<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = LLMResult<ModelInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get information about a specific model
Source§fn supports_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn supports_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a model is supported
Source§fn estimate_tokens(&self, text: &str) -> usize
fn estimate_tokens(&self, text: &str) -> usize
Estimate token count for text (optional override)
Source§fn validate_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate a request before sending
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check for the provider
Source§fn handle_create_message<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<CreateMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_create_message<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<CreateMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle MCP CreateMessageRequest (adapts to LLM types) Read more
Auto Trait Implementations§
impl Freeze for AnthropicProvider
impl RefUnwindSafe for AnthropicProvider
impl Send for AnthropicProvider
impl Sync for AnthropicProvider
impl Unpin 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