/** * OpenAI provider adapter. * * Uses a dynamic import so the `openai` package is an optional peer dependency. * If the package is not installed, a clear installation error is thrown at * call-time rather than at module load time. * * All OpenAI SDK types are inlined below so this file compiles without the * `openai` package present in node_modules. */ import type { LLMClient, ChatParams, ChatResponse } from "./types.js"; import type { ProviderName } from "./factory.js"; /** * LLMClient implementation that wraps the OpenAI chat completions API. * * The `openai` npm package is dynamically imported so it remains an optional * peer dependency. If the package is absent a descriptive install error is * thrown on the first call. * * Supports: * - Function/tool calling via the tools array format * - Parallel tool calls * - Custom base URL for OpenAI-compatible endpoints * - Optional provider-level configuration */ export declare class OpenAIAdapter implements LLMClient { private readonly model; private readonly apiKey; private readonly baseURL; private readonly providerConfig; /** * Provider key used for CostMeter lookups. Defaults to "openai"; overridden * to "openai-compat" by {@link OpenAICompatAdapter} so DeepSeek/Grok prices * are looked up instead of OpenAI's (they share this class's `chat()`). */ protected readonly costProvider: ProviderName; /** Lazily initialised after the dynamic import succeeds. */ private client; constructor(model: string, apiKey?: string, endpoint?: string, providerConfig?: Record); /** * Lazily import the `openai` package and return the initialised client. * * @throws If the `openai` package is not installed. */ private getClient; chat(params: ChatParams): Promise; } //# sourceMappingURL=openai.d.ts.map