Skip to main content

Crate llmkit_anthropic

Crate llmkit_anthropic 

Source
Expand description

Anthropic (Claude) provider adapter for llmkit-rs.

Implements llmkit_core::LlmProvider against the Anthropic Messages API (/v1/messages), including its distinct SSE event format. Embeddings are not offered by Anthropic and return llmkit_core::LlmError::Unsupported.

use llmkit_anthropic::AnthropicProvider;
use llmkit_core::{LlmProvider, ChatRequest};

let provider = AnthropicProvider::from_env()?.model("claude-opus-4-8");
let resp = provider.chat(ChatRequest::builder().user("Hello, Claude").build()).await?;
println!("{}", resp.text().unwrap_or_default());

Structsยง

AnthropicProvider
Anthropic (Claude) provider over the /v1/messages API.