import { RequestMetadata } from '@vscode/copilot-api';
import { Raw } from '@vscode/prompt-tsx';
import type { CancellationToken } from 'vscode';
import { ITokenizer, TokenizerType } from '../../../util/common/tokenizer';
import { AsyncIterableObject } from '../../../util/vs/base/common/async';
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
import { IAuthenticationService } from '../../authentication/common/authentication';
import { IChatMLFetcher, Source } from '../../chat/common/chatMLFetcher';
import { ChatLocation, ChatResponse } from '../../chat/common/commonTypes';
import { IConfigurationService } from '../../configuration/common/configurationService';
import { ILogService } from '../../log/common/logService';
import { FinishedCallback, OptionalChatRequestParams } from '../../networking/common/fetch';
import { IFetcherService, Response } from '../../networking/common/fetcherService';
import { IChatEndpoint, ICreateEndpointBodyOptions, IEndpointBody, IMakeChatRequestOptions } from '../../networking/common/networking';
import { ChatCompletion, RawMessageConversionCallback } from '../../networking/common/openai';
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
import { ITelemetryService, TelemetryProperties } from '../../telemetry/common/telemetry';
import { TelemetryData } from '../../telemetry/common/telemetryData';
import { ITokenizerProvider } from '../../tokenizer/node/tokenizer';
import { ICAPIClientService } from '../common/capiClient';
import { IDomainService } from '../common/domainService';
import { CustomModel, IChatModelInformation } from '../common/endpointProvider';
/**
 * The default processor for the stream format from CAPI
 */
export declare function defaultChatResponseProcessor(telemetryService: ITelemetryService, logService: ILogService, response: Response, expectedNumChoices: number, finishCallback: FinishedCallback, telemetryData: TelemetryData, cancellationToken?: CancellationToken | undefined): Promise<AsyncIterableObject<ChatCompletion>>;
export declare function defaultNonStreamChatResponseProcessor(response: Response, finishCallback: FinishedCallback, telemetryData: TelemetryData): Promise<AsyncIterableObject<ChatCompletion>>;
export declare class ChatEndpoint implements IChatEndpoint {
    readonly modelMetadata: IChatModelInformation;
    protected readonly _domainService: IDomainService;
    private readonly _capiClientService;
    private readonly _fetcherService;
    private readonly _telemetryService;
    private readonly _authService;
    private readonly _chatMLFetcher;
    private readonly _tokenizerProvider;
    protected readonly _instantiationService: IInstantiationService;
    protected readonly _configurationService: IConfigurationService;
    private readonly _expService;
    private readonly _maxTokens;
    private readonly _maxOutputTokens;
    readonly model: string;
    readonly name: string;
    readonly version: string;
    readonly family: string;
    readonly tokenizer: TokenizerType;
    readonly showInModelPicker: boolean;
    readonly isDefault: boolean;
    readonly isFallback: boolean;
    readonly supportsToolCalls: boolean;
    readonly supportsVision: boolean;
    readonly supportsPrediction: boolean;
    readonly isPremium?: boolean | undefined;
    readonly multiplier?: number | undefined;
    readonly restrictedToSkus?: string[] | undefined;
    readonly customModel?: CustomModel | undefined;
    private readonly _supportsStreaming;
    private _policyDetails;
    constructor(modelMetadata: IChatModelInformation, _domainService: IDomainService, _capiClientService: ICAPIClientService, _fetcherService: IFetcherService, _telemetryService: ITelemetryService, _authService: IAuthenticationService, _chatMLFetcher: IChatMLFetcher, _tokenizerProvider: ITokenizerProvider, _instantiationService: IInstantiationService, _configurationService: IConfigurationService, _expService: IExperimentationService, _logService: ILogService);
    getExtraHeaders(): Record<string, string>;
    get modelMaxPromptTokens(): number;
    get maxOutputTokens(): number;
    get urlOrRequestMetadata(): string | RequestMetadata;
    protected get useResponsesApi(): boolean;
    protected get useMessagesApi(): boolean;
    get degradationReason(): string | undefined;
    get policy(): 'enabled' | {
        terms: string;
    };
    get apiType(): string;
    interceptBody(body: IEndpointBody | undefined): void;
    createRequestBody(options: ICreateEndpointBodyOptions): IEndpointBody;
    protected getCompletionsCallback(): RawMessageConversionCallback | undefined;
    protected customizeMessagesBody(body: IEndpointBody): IEndpointBody;
    protected customizeResponsesBody(body: IEndpointBody): IEndpointBody;
    protected customizeCapiBody(body: IEndpointBody): IEndpointBody;
    processResponseFromChatEndpoint(telemetryService: ITelemetryService, logService: ILogService, response: Response, expectedNumChoices: number, finishCallback: FinishedCallback, telemetryData: TelemetryData, cancellationToken?: CancellationToken | undefined): Promise<AsyncIterableObject<ChatCompletion>>;
    acceptChatPolicy(): Promise<boolean>;
    acquireTokenizer(): ITokenizer;
    makeChatRequest2(options: IMakeChatRequestOptions, token: CancellationToken): Promise<ChatResponse>;
    protected _makeChatRequest2(options: IMakeChatRequestOptions, token: CancellationToken): Promise<ChatResponse>;
    makeChatRequest(debugName: string, messages: Raw.ChatMessage[], finishedCb: FinishedCallback | undefined, token: CancellationToken, location: ChatLocation, source?: Source, requestOptions?: Omit<OptionalChatRequestParams, 'n'>, userInitiatedRequest?: boolean, telemetryProperties?: TelemetryProperties): Promise<ChatResponse>;
    cloneWithTokenOverride(modelMaxPromptTokens: number): IChatEndpoint;
}
export declare class RemoteAgentChatEndpoint extends ChatEndpoint {
    private readonly _requestMetadata;
    constructor(modelMetadata: IChatModelInformation, _requestMetadata: RequestMetadata, domainService: IDomainService, capiClientService: ICAPIClientService, fetcherService: IFetcherService, telemetryService: ITelemetryService, authService: IAuthenticationService, chatMLFetcher: IChatMLFetcher, tokenizerProvider: ITokenizerProvider, instantiationService: IInstantiationService, configService: IConfigurationService, experimentService: IExperimentationService, logService: ILogService);
    processResponseFromChatEndpoint(telemetryService: ITelemetryService, logService: ILogService, response: Response, expectedNumChoices: number, finishCallback: FinishedCallback, telemetryData: TelemetryData, cancellationToken?: CancellationToken | undefined): Promise<AsyncIterableObject<ChatCompletion>>;
    get urlOrRequestMetadata(): RequestMetadata;
}
//# sourceMappingURL=chatEndpoint.d.ts.map