/** * OpenAI-compatible provider adapter * * Handles OpenAI API format for request building, response parsing, * and message formatting. Used as the default provider. */ import type { ContentPart, PromptContent } from '../types.js'; import type { TooledPromptEmitter } from '../events.js'; import type { ProviderAdapter, ToolCallInfo, ToolResultInfo, ParsedResponse, BuildRequestParams, BuildRequestResult } from './types.js'; type OpenAIToolCall = { id: string; type: 'function'; function: { name: string; arguments: string; }; }; export type OpenAIMessage = { role: 'system'; content: PromptContent; } | { role: 'user'; content: PromptContent; } | { role: 'assistant'; content: string | null; tool_calls?: OpenAIToolCall[]; } | { role: 'tool'; tool_call_id: string; content: string | ContentPart[]; }; export declare class OpenAIProvider implements ProviderAdapter { buildRequest(params: BuildRequestParams): BuildRequestResult; formatUserMessage(content: PromptContent, prependImages?: ContentPart[]): OpenAIMessage; formatAssistantMessage(content: string, toolCalls: ToolCallInfo[]): OpenAIMessage; formatToolResults(results: ToolResultInfo[]): OpenAIMessage[]; parseResponse(response: Response, streaming: boolean, emitter: TooledPromptEmitter, chunkTimeoutMs?: number, signal?: AbortSignal): Promise; } export {}; //# sourceMappingURL=openai.d.ts.map