/**
 * provider.ts
 *
 * Instrumented Promptfoo custom provider that wraps any underlying LLM
 * provider and records all HTTP activity the agent performs during a task.
 *
 * This is the integration point between the observation infrastructure
 * (RequestRecorder) and Promptfoo's evaluation pipeline. It:
 *
 *   1. Starts a recording session before the LLM call
 *   2. Delegates to the real provider (calls OpenAI directly)
 *   3. Stops recording and attaches the AgentBehaviorLog to
 *      ProviderResponse.metadata so it flows through scoring
 *
 * Promptfoo config usage:
 *
 *   providers:
 *     - id: file://src/agent-observer/provider.ts
 *       label: "gpt-4o (observed)"
 *       config:
 *         model: gpt-4o
 *         temperature: 0
 *         max_tokens: 4096
 *         observe: true
 *         observerOptions:
 *           maxPreviewBytes: 2048
 *           captureResponsePreview: true
 *
 * Promptfoo loads this file and instantiates the default export class.
 */
import { RequestRecorder } from "./proxy.js";
interface CallApiContextParams {
    prompt?: {
        raw: string;
        label?: string;
    };
    vars?: Record<string, object | string>;
}
interface ProviderOptions {
    config?: Record<string, unknown>;
    id?: string;
}
interface ProviderResponse {
    cached?: boolean;
    cost?: number;
    error?: string;
    metadata?: Record<string, unknown>;
    output?: object | string;
    tokenUsage?: {
        total?: number;
        prompt?: number;
        completion?: number;
        cached?: number;
    };
}
export default class InstrumentedProvider {
    config: Record<string, unknown>;
    protected providerId: string;
    private parsedConfig;
    private recorder;
    constructor(options: ProviderOptions);
    /**
     * Main Promptfoo provider entry point. Called for each test case.
     */
    callApi(prompt: string, context?: CallApiContextParams): Promise<ProviderResponse>;
    /**
     * Exposes the recorder for external integrations (e.g., agents that
     * make their own HTTP requests outside the provider call).
     */
    getRecorder(): RequestRecorder;
    id(): string;
    /**
     * Detect whether the model should use the Responses API based on config.
     */
    private isResponsesModel;
    /**
     * Calls OpenAI directly. Routes to the Responses API for reasoning
     * models and Chat Completions API for everything else. Uses the
     * recorder's fetch wrapper so the API call is captured.
     */
    private callOpenAI;
    /**
     * Calls OpenAI Chat Completions API (non-reasoning models).
     */
    private callOpenAIChatCompletions;
    /**
     * Calls OpenAI Responses API (reasoning models like GPT-5.x, o-series).
     */
    private callOpenAIResponses;
}
export {};
