Expand description
Anthropic Claude SDK for Miyabi LLM
This crate provides Anthropic Claude API integration for the Miyabi LLM framework.
It implements the LlmClient and LlmStreamingClient traits from miyabi-llm-core.
§Features
- Claude 3.5 Sonnet support
- Tool/function calling
- Streaming responses via SSE
- Environment variable configuration
§Example
use miyabi_llm_anthropic::AnthropicClient;
use miyabi_llm_core::{LlmClient, Message};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = AnthropicClient::from_env()?;
let messages = vec![Message::user("Hello!")];
let response = client.chat(messages).await?;
println!("Response: {}", response);
Ok(())
}Structs§
- Anthropic
Client - Anthropic Claude client
- Anthropic
Content - Content block in Anthropic response
- Anthropic
Message - Anthropic message format
- Anthropic
Response - Anthropic API response
- Anthropic
Tool - Anthropic tool definition
- Anthropic
Usage - Token usage information
- Message
- Message in a conversation
- Tool
Call - Tool call from LLM
- Tool
Definition - Tool definition for LLM Function Calling
Enums§
- LlmError
- Core LLM error type
- Role
- Message role
- Stream
Event - Stream event type for more detailed streaming information
- Tool
Call Response - Response from LLM with tool calling support
Traits§
- LlmClient
- LLM Client trait - unified interface for all providers
- LlmStreaming
Client - LLM Streaming Client trait
Type Aliases§
- Result
- Result type for LLM operations
- Stream
Response - Type alias for streaming response