/** * Anthropic API Client Module * * Handles communication with the Anthropic Claude API. * Formats requests according to the Anthropic Messages API specification * and parses both regular and streaming responses. */ import type { LLMStreamChunk } from '../../llm_api/types.js'; export interface AnthropicTextContent { type: 'text'; text: string; } export interface AnthropicImageContent { type: 'image'; source: { type: 'base64'; media_type: string; data: string; }; } export interface AnthropicDocumentContent { type: 'document'; source: { type: 'base64'; media_type: 'application/pdf'; data: string; }; } export type AnthropicContent = AnthropicTextContent | AnthropicImageContent | AnthropicDocumentContent; export interface AnthropicMessage { role: 'user' | 'assistant'; content: AnthropicContent[]; } export interface AnthropicGenerationConfig { max_tokens?: number; temperature?: number; top_p?: number; top_k?: number; } /** * Call the Anthropic Messages API (non-streaming) * @param opts - API call options * @returns Raw API response and HTTP status code */ export declare function call_anthropic_api(opts: { api_key: string; api_url: string; api_version: string; model: string; messages: AnthropicMessage[]; generation_config?: AnthropicGenerationConfig; }): Promise<{ raw: Record; status: number; }>; /** * Call the Anthropic Messages API with streaming enabled. * Yields LLMStreamChunk objects as SSE events arrive. * * @param opts - API call options (same as non-streaming, plus stream=true) * @yields LLMStreamChunk objects with text deltas or done/error signals */ export declare function call_anthropic_api_stream(opts: { api_key: string; api_url: string; api_version: string; model: string; messages: AnthropicMessage[]; generation_config?: AnthropicGenerationConfig; }): AsyncGenerator; //# sourceMappingURL=anthropic_client.d.ts.map