import { Raw } from '@vscode/prompt-tsx';
import type { OpenAI } from 'openai';
import { Response } from '../../../platform/networking/common/fetcherService';
import { AsyncIterableObject } from '../../../util/vs/base/common/async';
import { IInstantiationService, ServicesAccessor } from '../../../util/vs/platform/instantiation/common/instantiation';
import { IConfigurationService } from '../../configuration/common/configurationService';
import { ILogService } from '../../log/common/logService';
import { FinishedCallback } from '../../networking/common/fetch';
import { IChatEndpoint, ICreateEndpointBodyOptions, IEndpointBody } from '../../networking/common/networking';
import { ChatCompletion } from '../../networking/common/openai';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../telemetry/common/telemetry';
import { TelemetryData } from '../../telemetry/common/telemetryData';
export declare function getResponsesApiCompactionThreshold(configService: IConfigurationService, expService: IExperimentationService, endpoint: IChatEndpoint): number | undefined;
export declare function createResponsesRequestBody(accessor: ServicesAccessor, options: ICreateEndpointBodyOptions, model: string, endpoint: IChatEndpoint): IEndpointBody;
export declare function getResponsesApiCompactionThresholdFromBody(body: Pick<IEndpointBody, 'context_management'>): number | undefined;
/**
 * This is an approximate responses input -> raw messages helper, should be used for logging only
 */
export declare function responseApiInputToRawMessagesForLogging(body: OpenAI.Responses.ResponseCreateParams): Raw.ChatMessage[];
export declare function processResponseFromChatEndpoint(instantiationService: IInstantiationService, telemetryService: ITelemetryService, logService: ILogService, response: Response, expectedNumChoices: number, finishCallback: FinishedCallback, telemetryData: TelemetryData, compactionThreshold?: number): Promise<AsyncIterableObject<ChatCompletion>>;
export declare function sendCompletionOutputTelemetry(telemetryService: ITelemetryService, logService: ILogService, completion: ChatCompletion, telemetryData: TelemetryData): void;
export declare class OpenAIResponsesProcessor {
    private readonly telemetryData;
    private readonly telemetryService;
    private readonly requestId;
    private readonly ghRequestId;
    private readonly serverExperiments;
    private readonly compactionThreshold;
    private readonly logService;
    private textAccumulator;
    private hasReceivedReasoningSummary;
    private sawCompactionMessage;
    private latestCompactionOutputIndex;
    private latestCompactionItem;
    /** Tracks the output_index of the last text delta to detect output item boundaries */
    private lastTextDeltaOutputIndex;
    /** Maps output_index to { name, callId, arguments } for streaming tool call updates */
    private readonly toolCallInfo;
    constructor(telemetryData: TelemetryData, telemetryService: ITelemetryService, requestId: string, ghRequestId: string, serverExperiments: string, compactionThreshold: number | undefined, logService: ILogService);
    private getCompactionItemsInChunk;
    private captureCompactionItem;
    push(chunk: OpenAI.Responses.ResponseStreamEvent, _onProgress: FinishedCallback): ChatCompletion | undefined;
    /**
     * Build a {@link ChatCompletion} for a terminal Responses API event other than
     * `response.completed` (i.e. `response.incomplete` or `response.failed`). The
     * resulting completion is fed into the same downstream switch as a normal
     * completion so callers can map it to the appropriate user-facing error.
     */
    private buildTerminalCompletion;
}
//# sourceMappingURL=responsesApi.d.ts.map