import { OpenAI } from 'openai'; import { type LLMAssistanceOptions, type LLMAssistanceResult, type LLMAssistanceMessage, type LLMCreateChatOptions, type LLMCreateChatResult, type LLMCreateFileStorageOptions, type LLMCreateFileStorageResult, type LLMInstanceOptions, LLMProviders, type LLMUploadFileOptions, type LLMUploadFileResult, type LLMStructuredResult, type LLMUploadedFile } from '../../../LLMService.typedefs'; import { type LLMLoggerInterface } from '../../../utilities/logger'; import { type LLMReporterInterface } from '../../../utilities/reporter'; import { LLMAssistanceService } from '../../../services'; import { type LLMSchemaInterface } from '../../../utilities/schema'; export declare class OpenAIAssistanceService | undefined> extends LLMAssistanceService { private uploadedFiles; private chatInstructions; /** * The restored history a chat was created with, kept only until the chat's * first message is traced. The model reads it from the conversation object, * so this copy exists so the first generation's traced input shows what the * model actually saw rather than the current turn alone. */ private pendingTraceHistory; constructor(logger: LLMLoggerInterface | undefined, reporter: Reporter, options?: LLMInstanceOptions[LLMProviders.OpenAI]); get instance(): OpenAI; uploadFile(fileOptions: LLMUploadFileOptions): Promise; getFile(path: string): Promise; deleteFile(fileId: string): Promise; createFileStorage(options: LLMCreateFileStorageOptions): Promise; deleteFileStorage(fileStorageId: string): Promise; createChat(options: LLMCreateChatOptions): Promise; deleteChat(chatId: string): Promise; private prepareAssistTools; private extractUsageFromResponse; private buildUsageMetrics; private readonly buildRoundOutcome; /** * The transcript a traced round of this turn shows. The Responses API keeps * earlier turns of the chat server-side in the conversation object, so a * round shows the chat's instructions, the history the chat was restored * with, this turn's input items, and everything the tool loop appends to * them afterwards. The restored history is shown once, on the chat's first * round, because that is the round it was actually read on. */ private startTracedConversation; private static buildReasoningRequest; protected assistInChatText(options: LLMAssistanceOptions): Promise; protected assistInChatStructured(options: LLMAssistanceOptions & { schema: LLMSchemaInterface; }): Promise; private convertCustomToolsToResponsesAPI; private serializeOfferedTools; private executeFunctionCall; private executeToolLoop; private getFunctionCallsFromResponse; private convertHistoryToResponsesInput; private convertLLMMessageToResponsesInput; countTokens(messages: LLMAssistanceMessage[]): Promise; }