/** * Anthropic Claude Provider Implementation * * Implements the LLMClient interface for Anthropic's Claude models. * Supports Claude 3.5 Sonnet, Claude 3 Opus, and Claude 3 Haiku with tool use and streaming. */ import type { LLMClient, LLMClientConfig, ChatParams, ChatResponse, ChatChunk, Message } from '../client'; /** * Supported Anthropic Claude models */ export declare const ANTHROPIC_MODELS: { readonly CLAUDE_3_5_SONNET: "claude-3-5-sonnet-20241022"; readonly CLAUDE_3_5_SONNET_LEGACY: "claude-3-5-sonnet-20240620"; readonly CLAUDE_3_OPUS: "claude-3-opus-20240229"; readonly CLAUDE_3_SONNET: "claude-3-sonnet-20240229"; readonly CLAUDE_3_HAIKU: "claude-3-haiku-20240307"; }; /** * Anthropic-specific configuration */ export interface AnthropicClientConfig extends LLMClientConfig { /** Anthropic API version (defaults to latest) */ apiVersion?: string; /** Default model to use if not specified in requests */ defaultModel?: string; } /** * Anthropic Claude LLM Client * * Provides integration with Anthropic's Claude models through the Messages API. */ export declare class AnthropicClient implements LLMClient { readonly provider = "anthropic"; private client; private config; constructor(config: AnthropicClientConfig); /** * Generate a chat completion */ chat(params: ChatParams): Promise; /** * Generate a streaming chat completion */ chatStream(params: ChatParams): AsyncIterableIterator; /** * Count tokens in a message or text * * Note: Anthropic doesn't provide a direct token counting API. * This uses a rough estimation based on character count. * For accurate counts, make an actual API call with max_tokens=1. */ countTokens(input: string | Message[], model: string): Promise; /** * List available models */ listModels(): Promise; /** * Validate API credentials */ validateCredentials(): Promise; /** * Convert messages from LLMClient format to Anthropic format */ private convertMessages; /** * Convert tools from LLMClient format to Anthropic format */ private convertTools; /** * Convert Anthropic response to LLMClient format */ private convertResponse; /** * Convert streaming event to chat chunk */ private convertStreamEvent; /** * Convert Anthropic stop reason to LLMClient finish reason */ private convertStopReason; /** * Convert usage statistics */ private convertUsage; /** * Handle and convert Anthropic errors to LLMClient errors */ private handleError; } //# sourceMappingURL=anthropic.d.ts.map