llmkit_anthropic/lib.rs
1//! Anthropic (Claude) provider adapter for `llmkit-rs`.
2//!
3//! Implements [`llmkit_core::LlmProvider`] against the Anthropic Messages API
4//! (`/v1/messages`), including its distinct SSE event format. Embeddings are not
5//! offered by Anthropic and return [`llmkit_core::LlmError::Unsupported`].
6//!
7//! ```no_run
8//! use llmkit_anthropic::AnthropicProvider;
9//! use llmkit_core::{LlmProvider, ChatRequest};
10//!
11//! # async fn run() -> llmkit_core::LlmResult<()> {
12//! let provider = AnthropicProvider::from_env()?.model("claude-opus-4-8");
13//! let resp = provider.chat(ChatRequest::builder().user("Hello, Claude").build()).await?;
14//! println!("{}", resp.text().unwrap_or_default());
15//! # Ok(()) }
16//! ```
17
18#![forbid(unsafe_code)]
19#![deny(missing_docs)]
20
21mod chat;
22mod provider;
23mod stream;
24mod types;
25
26pub use provider::AnthropicProvider;