Expand description
Anthropic Claude provider for the llm-stack SDK.
This crate implements Provider for Anthropic’s
Messages API, supporting both non-streaming and streaming generation
with full tool-calling and extended thinking support.
§Quick start
use llm_stack_anthropic::{AnthropicConfig, AnthropicProvider};
use llm_stack::{ChatMessage, ChatParams, Provider};
let provider = AnthropicProvider::new(AnthropicConfig {
api_key: std::env::var("ANTHROPIC_API_KEY").unwrap(),
..Default::default()
});
let params = ChatParams {
messages: vec![ChatMessage::user("Hello!")],
..Default::default()
};
let response = provider.generate(¶ms).await?;
println!("{}", response.text().unwrap_or("no text"));Structs§
- Anthropic
Config - Configuration for the Anthropic provider.
- Anthropic
Factory - Factory for creating
AnthropicProviderinstances from configuration. - Anthropic
Provider - Anthropic Claude provider implementing
Provider.
Functions§
- register_
global - Registers the Anthropic factory with the global registry.