import type * as plugins from './plugins.js'; import type { IAnthropicMessagesModel, TAnthropicMessagesEffort } from './interfaces.js'; import type { ThinkingSignatures } from './signature.js'; type TParsedFile = { kind: 'file'; mediaType: string; data: { type: 'data'; data: string; } | { type: 'url'; url: URL; }; }; type TParsedText = { kind: 'text'; text: string; }; type TParsedToolResult = { kind: 'tool_result'; toolUseId: string; isError: boolean; content: string | Array; }; type TParsedUserBlock = TParsedText | TParsedFile | TParsedToolResult; type TParsedAssistantBlock = TParsedText | { kind: 'thinking'; thinking: string; signature: string; } | { kind: 'redacted_thinking'; } | { kind: 'tool_use'; id: string; name: string; input: unknown; }; type TParsedMessage = { role: 'system'; text: string; } | { role: 'user'; blocks: TParsedUserBlock[]; } | { role: 'assistant'; blocks: TParsedAssistantBlock[]; }; interface IParsedTool { name: string; description?: string; inputSchema: plugins.LanguageModelV4FunctionTool['inputSchema']; strict?: boolean; inputExamples?: Array<{ input: plugins.JSONObject; }>; } type TParsedToolChoice = { type: 'auto'; } | { type: 'any'; } | { type: 'none'; } | { type: 'tool'; name: string; }; /** A request of the Messages API, checked and reduced to what this service translates. */ export interface IAnthropicMessagesParsedRequest { modelId: string; stream: boolean; maxTokens: number; system: string[]; messages: TParsedMessage[]; tools: IParsedTool[]; toolChoice?: TParsedToolChoice; parallelToolCalls: boolean; thinking: false | { display: 'summarized' | 'omitted'; }; effort?: TAnthropicMessagesEffort; responseFormat?: { type: 'json'; schema: plugins.LanguageModelV4FunctionTool['inputSchema']; }; temperature?: number; topP?: number; topK?: number; stopSequences?: string[]; } /** Checks a Messages API request body and reduces it to what this service translates. */ export declare const parseAnthropicMessagesRequest: (bodyArg: unknown) => IAnthropicMessagesParsedRequest; /** Maps tool names to the names the model is sent, for a model with a shorter tool name limit. */ export declare class ToolNames { private readonly toModel; private readonly fromModel; static create(namesArg: Iterable, limitArg: number | undefined): Promise; sent(nameArg: string): string; /** The client's name for a tool the model called, or `undefined` for a name the request never offered. */ received(nameArg: string): string | undefined; } export interface IAnthropicMessagesModelCall { options: Omit; toolNames: ToolNames; /** Response headers that name what this request received differently from what it asked for. */ notices: Record; } /** Translates a parsed request into the call of one model. */ export declare const createAnthropicMessagesModelCall: (requestArg: IAnthropicMessagesParsedRequest, modelArg: IAnthropicMessagesModel, signaturesArg: ThinkingSignatures, sessionIdArg: string | undefined) => Promise; export {};