/** * Message format translation between OpenAI (canonical) and Anthropic. * * OpenAI's chat completion format is the canonical representation used * throughout the codebase. This module translates to/from Anthropic's * format when a Claude model is selected. */ import type { ChatMessage, ToolDefinition, LLMResponse } from './types'; interface AnthropicMessage { role: 'user' | 'assistant'; content: string | AnthropicContentBlock[]; } type AnthropicContentBlock = { type: 'text'; text: string; } | { type: 'image'; source: { type: 'base64'; media_type: string; data: string; }; } | { type: 'tool_use'; id: string; name: string; input: Record; } | { type: 'tool_result'; tool_use_id: string; content: string; }; interface AnthropicTool { name: string; description?: string; input_schema: Record; } /** * Extract system messages and translate the rest for Anthropic's API. */ export declare function translateMessagesToAnthropic(messages: ChatMessage[]): { system: string; messages: AnthropicMessage[]; }; /** * Translate OpenAI tool definitions to Anthropic format. */ export declare function translateToolsToAnthropic(tools: ToolDefinition[]): AnthropicTool[]; /** * Translate an Anthropic response to our canonical LLMResponse. */ export declare function translateAnthropicResponse(response: { content: Array<{ type: string; text?: string; id?: string; name?: string; input?: unknown; }>; usage?: { input_tokens: number; output_tokens: number; }; stop_reason?: string; }): LLMResponse; export {};