import { OpenAI } from 'openai'; import type { LLMCompletionMessage, LLMCompletionResult, LLMInstanceOptions, LLMModel, LLMProviders, LLMSendMessageOptions, LLMStructuredResult } from '../../LLMService.typedefs'; import { type LLMLoggerInterface } from '../../utilities/logger'; import { type LLMReporterInterface } from '../../utilities/reporter'; import { LLMCompletionService } from '../../services'; import { type LLMSchemaInterface, type InferSchema } from '../../utilities/schema'; type OpenAICompatibleProvider = LLMProviders.OpenAI | LLMProviders.LLMAPI; export declare class OpenAICompatibleCompletionService | undefined> extends LLMCompletionService { constructor(provider: Provider, logger: LLMLoggerInterface | undefined, reporter: Reporter, options?: LLMInstanceOptions[Provider]); get instance(): OpenAI; sendMessage(options: LLMSendMessageOptions & { schema: S; }): Promise>>; sendMessage(options: LLMSendMessageOptions): Promise; countTokens(messages: LLMCompletionMessage[], _model: LLMModel): Promise; protected sendTextMessage(options: LLMSendMessageOptions): Promise; protected sendStructuredMessage(options: LLMSendMessageOptions & { schema: LLMSchemaInterface; }): Promise; /** * Builds the provider-native message array before the request is attempted, * so the success and the error path trace the same transcript rather than one * of them falling back to a raw `{ message, history }` object. It runs outside * the request's `try` on purpose: combining and truncating messages is local * work, and its failure is a configuration error rather than a provider one. */ protected prepareRequestMessages(options: LLMSendMessageOptions): Promise; private extractUsageFromCompletion; } export {};