import { P as ProviderCallOptions, R as ReforgeProvider } from '../types-BthWWfka.cjs'; import 'zod'; interface OpenAICompatibleCallOptions extends ProviderCallOptions { temperature?: number; max_tokens?: number; response_format?: unknown; tools?: unknown; tool_choice?: unknown; reasoning_effort?: "low" | "medium" | "high"; parallel_tool_calls?: boolean; stream?: boolean; } /** * Minimal subset of the `OpenAI` client used by the adapter. * This avoids importing the full `openai` package at the type level * while still providing type-safety for users who pass their client. */ interface OpenAICompatibleClient { chat: { completions: { create(params: Record): Promise<{ choices: Array<{ message?: { content?: unknown; refusal?: unknown; }; text?: unknown; finish_reason?: unknown; }>; }>; }; }; } /** * Create a `ReforgeProvider` for any OpenAI-compatible API. * * Works with: **OpenAI**, **OpenRouter**, **Together AI**, **Groq**, * **Fireworks**, **Perplexity**, **Ollama**, **LM Studio**, **vLLM**, * **Deepseek**, **Mistral**, and any other provider that implements the * `/v1/chat/completions` API shape. * * The user passes their own pre-configured client (with `baseURL` and * `apiKey` already set). Reforge never manages credentials. * * @param client - An `OpenAI` client instance (from the `openai` npm package). * @param model - The model identifier (e.g. `"gpt-4o"`, `"llama-3-70b"`). * @returns A `ReforgeProvider` ready to use with `forge()`. * * @example * ```ts * import OpenAI from 'openai'; * import { openaiCompatible } from 'reforge-ai/openai-compatible'; * * // Direct OpenAI * const provider = openaiCompatible(new OpenAI(), 'gpt-4o'); * * // OpenRouter * const provider = openaiCompatible( * new OpenAI({ baseURL: 'https://openrouter.ai/api/v1', apiKey: '...' }), * 'anthropic/claude-3.5-sonnet', * ); * ``` */ declare function openaiCompatible(client: OpenAICompatibleClient, model: string): ReforgeProvider; export { type OpenAICompatibleCallOptions, type OpenAICompatibleClient, openaiCompatible };