import type { ChatCompletionCreateParamsNonStreaming, ChatCompletionMessageParam } from "openai/resources/chat/completions"; import type { PotEntry } from "../../translate/pot.js"; import { type TranslationValidationStats } from "../../translate/validation.js"; import { type ParsedTranslation } from "../../translate/xml.js"; export interface OpenAITranslationClient { readonly chat: { readonly completions: { create(body: ChatCompletionCreateParamsNonStreaming): Promise; }; }; } export interface OpenAIChatCompletionResponse { readonly choices: readonly { readonly message: { readonly content: string | null; }; }[]; readonly usage?: { readonly completion_tokens?: number; readonly prompt_tokens?: number; readonly total_tokens?: number; }; } export type OpenAIClientFactory = (options: { readonly apiKey: string; readonly timeoutMs: number; }) => OpenAITranslationClient; export type OpenAITranslateBatchResult = { readonly debug: { readonly messages: readonly ChatCompletionMessageParam[]; readonly response?: string; }; readonly dryRun: boolean; readonly missingEntries: readonly PotEntry[]; readonly ok: true; readonly translations: readonly ParsedTranslation[]; readonly validationStats: TranslationValidationStats; } | { readonly debug?: { readonly messages: readonly ChatCompletionMessageParam[]; readonly response?: string; }; readonly error: string; readonly ok: false; readonly retryable: boolean; }; export interface TranslateOpenAIBatchOptions { readonly apiKey?: string; readonly dictionaryMatches?: readonly { readonly source: string; readonly target: string; }[]; readonly dryRun: boolean; readonly entries: readonly PotEntry[]; readonly maxRetries: number; readonly maxTokens?: number; readonly model: string; readonly pluralCount: number; readonly promptTemplate: string; readonly retryDelayMs: number; readonly sourceLanguage: string; readonly targetLanguage: string; readonly temperature: number; readonly timeoutSeconds: number; } export declare function translateOpenAIBatch(options: TranslateOpenAIBatchOptions, createClient?: OpenAIClientFactory): Promise;