import type { ConversationMessage, LLMProvider, ProviderId, ProviderModelInfo, ProviderResponse, ProviderToolDefinition, StreamChunk } from '../core/types.js';
/**
 * Security utility for safe JSON parsing with protection against prototype pollution
 */
export declare function safeJSONParse<T = unknown>(json: string, options?: {
    maxDepth?: number;
    maxProperties?: number;
}): T;
/**
 * Custom error class for provider-specific failures
 */
export declare class ProviderStreamError extends Error {
    readonly isRetryable: boolean;
    readonly originalError?: Error;
    readonly providerId: string;
    constructor(message: string, providerId: string, originalError?: Error, isRetryable?: boolean);
}
interface OpenAIChatCompletionsOptions {
    apiKey: string;
    model: string;
    providerId?: ProviderId;
    baseURL?: string;
    /** Request timeout in milliseconds (default: 120000) */
    timeout?: number;
    /** Maximum retries for transient errors (default: 3) */
    maxRetries?: number;
    /** Optional temperature override */
    temperature?: number;
    /** Maximum completion tokens to request (default: 4096 to avoid runaway outputs) */
    maxTokens?: number;
}
export declare class OpenAIChatCompletionsProvider implements LLMProvider {
    readonly id: ProviderId;
    readonly model: string;
    private readonly client;
    private readonly maxRetries;
    private readonly temperature?;
    private readonly maxTokens;
    private readonly requestCount;
    private readonly lastRequestTime;
    constructor(options: OpenAIChatCompletionsOptions);
    /**
     * Sleep for a given number of milliseconds
     */
    private sleep;
    /**
     * Calculate exponential backoff delay
     */
    private getBackoffDelay;
    /**
     * Execute request with retry logic for transient errors
     */
    private executeWithRetry;
    generate(messages: ConversationMessage[], tools: ProviderToolDefinition[]): Promise<ProviderResponse>;
    generateStream(messages: ConversationMessage[], tools: ProviderToolDefinition[]): AsyncIterableIterator<StreamChunk>;
    private cachedModelInfo;
    /**
     * Fetch model info from OpenAI API
     * Returns context window and token limits from the real API
     */
    getModelInfo(): Promise<ProviderModelInfo | null>;
}
export {};
//# sourceMappingURL=openaiChatCompletionsProvider.d.ts.map