import { VSBuffer } from "../../../../base/common/buffer.js";
import { CancellationToken } from "../../../../base/common/cancellation.js";
import { Event } from "../../../../base/common/event.js";
import { IDisposable } from "../../../../base/common/lifecycle.js";
import { URI } from "../../../../base/common/uri.js";
import { IContextKeyService } from "../../../../platform/contextkey/common/contextkey.service.js";
import { ExtensionIdentifier } from "../../../../platform/extensions/common/extensions.js";
import { ILogService } from "../../../../platform/log/common/log.service.js";
import { IStorageService } from "../../../../platform/storage/common/storage.service.js";
import { IExtensionService } from "../../../services/extensions/common/extensions.service.js";
import { ILanguageModelsService } from "./languageModels.service.js";
export declare enum ChatMessageRole {
    System = 0,
    User = 1,
    Assistant = 2
}
export declare enum ToolResultAudience {
    Assistant = 0,
    User = 1
}
export interface IChatMessageTextPart {
    type: "text";
    value: string;
    audience?: ToolResultAudience[];
}
export interface IChatMessageImagePart {
    type: "image_url";
    value: IChatImageURLPart;
}
export interface IChatMessageDataPart {
    type: "data";
    mimeType: string;
    data: VSBuffer;
    audience?: ToolResultAudience[];
}
export interface IChatImageURLPart {
    /**
     * The image's MIME type (e.g., "image/png", "image/jpeg").
     */
    mimeType: ChatImageMimeType;
    /**
     * The raw binary data of the image, encoded as a Uint8Array. Note: do not use base64 encoding. Maximum image size is 5MB.
     */
    data: VSBuffer;
}
/**
 * Enum for supported image MIME types.
 */
export declare enum ChatImageMimeType {
    PNG = "image/png",
    JPEG = "image/jpeg",
    GIF = "image/gif",
    WEBP = "image/webp",
    BMP = "image/bmp"
}
/**
 * Specifies the detail level of the image.
 */
export declare enum ImageDetailLevel {
    Low = "low",
    High = "high"
}
export interface IChatMessageToolResultPart {
    type: "tool_result";
    toolCallId: string;
    value: (IChatResponseTextPart | IChatResponsePromptTsxPart | IChatResponseDataPart)[];
    isError?: boolean;
}
export type IChatMessagePart = IChatMessageTextPart | IChatMessageToolResultPart | IChatResponseToolUsePart | IChatMessageImagePart | IChatMessageDataPart;
export interface IChatMessage {
    readonly name?: string | undefined;
    readonly role: ChatMessageRole;
    readonly content: IChatMessagePart[];
}
export interface IChatResponseTextPart {
    type: "text";
    value: string;
    audience?: ToolResultAudience[];
}
export interface IChatResponsePromptTsxPart {
    type: "prompt_tsx";
    value: unknown;
}
export interface IChatResponseDataPart {
    type: "data";
    value: IChatImageURLPart;
    audience?: ToolResultAudience[];
}
export interface IChatResponseToolUsePart {
    type: "tool_use";
    name: string;
    toolCallId: string;
    parameters: any;
}
export interface IChatResponsePullRequestPart {
    type: "pullRequest";
    uri: URI;
    title: string;
    description: string;
    author: string;
    linkTag: string;
}
export type IExtendedChatResponsePart = IChatResponsePullRequestPart;
export type IChatResponsePart = IChatResponseTextPart | IChatResponseToolUsePart | IChatResponseDataPart;
export interface IChatResponseFragment {
    index: number;
    part: IChatResponsePart;
}
export interface ILanguageModelChatMetadata {
    readonly extension: ExtensionIdentifier;
    readonly name: string;
    readonly id: string;
    readonly vendor: string;
    readonly version: string;
    readonly description?: string;
    readonly cost?: string;
    readonly family: string;
    readonly maxInputTokens: number;
    readonly maxOutputTokens: number;
    readonly isDefault?: boolean;
    readonly isUserSelectable?: boolean;
    readonly modelPickerCategory: {
        label: string;
        order: number;
    } | undefined;
    readonly auth?: {
        readonly providerLabel: string;
        readonly accountLabel?: string;
    };
    readonly capabilities?: {
        readonly vision?: boolean;
        readonly toolCalling?: boolean;
        readonly agentMode?: boolean;
    };
}
export declare namespace ILanguageModelChatMetadata {
    function suitableForAgentMode(metadata: ILanguageModelChatMetadata): boolean;
    function asQualifiedName(metadata: ILanguageModelChatMetadata): string;
}
export interface ILanguageModelChatResponse {
    stream: AsyncIterable<IChatResponseFragment | IChatResponseFragment[]>;
    result: Promise<any>;
}
export interface ILanguageModelChatProvider {
    onDidChange: Event<void>;
    prepareLanguageModelChat(options: {
        silent: boolean;
    }, token: CancellationToken): Promise<ILanguageModelChatMetadataAndIdentifier[]>;
    sendChatRequest(modelId: string, messages: IChatMessage[], from: ExtensionIdentifier, options: {
        [name: string]: any;
    }, token: CancellationToken): Promise<ILanguageModelChatResponse>;
    provideTokenCount(modelId: string, message: string | IChatMessage, token: CancellationToken): Promise<number>;
}
export interface ILanguageModelChat {
    metadata: ILanguageModelChatMetadata;
    sendChatRequest(messages: IChatMessage[], from: ExtensionIdentifier, options: {
        [name: string]: any;
    }, token: CancellationToken): Promise<ILanguageModelChatResponse>;
    provideTokenCount(message: string | IChatMessage, token: CancellationToken): Promise<number>;
}
export interface ILanguageModelChatSelector {
    readonly name?: string;
    readonly id?: string;
    readonly vendor?: string;
    readonly version?: string;
    readonly family?: string;
    readonly tokens?: number;
    readonly extension?: ExtensionIdentifier;
}
export interface ILanguageModelChatMetadataAndIdentifier {
    metadata: ILanguageModelChatMetadata;
    identifier: string;
}
export interface IUserFriendlyLanguageModel {
    vendor: string;
    displayName: string;
    managementCommand?: string;
}
export declare const languageModelExtensionPoint: import("../../../services/extensions/common/extensionsRegistry.js").IExtensionPoint<IUserFriendlyLanguageModel | IUserFriendlyLanguageModel[]>;
export declare class LanguageModelsService implements ILanguageModelsService {
    private readonly _extensionService;
    private readonly _logService;
    private readonly _storageService;
    readonly _serviceBrand: undefined;
    private readonly _store;
    private readonly _providers;
    private readonly _modelCache;
    private readonly _vendors;
    private readonly _modelPickerUserPreferences;
    private readonly _hasUserSelectableModels;
    private readonly _onLanguageModelChange;
    readonly onDidChangeLanguageModels: Event<void>;
    constructor(_extensionService: IExtensionService, _logService: ILogService, _storageService: IStorageService, _contextKeyService: IContextKeyService);
    dispose(): void;
    updateModelPickerPreference(modelIdentifier: string, showInModelPicker: boolean): void;
    getVendors(): IUserFriendlyLanguageModel[];
    getLanguageModelIds(): string[];
    lookupLanguageModel(modelIdentifier: string): ILanguageModelChatMetadata | undefined;
    private _clearModelCache;
    resolveLanguageModels(vendors: string | string[], silent: boolean): Promise<void>;
    selectLanguageModels(selector: ILanguageModelChatSelector, allowPromptingUser?: boolean): Promise<string[]>;
    registerLanguageModelProvider(vendor: string, provider: ILanguageModelChatProvider): IDisposable;
    sendChatRequest(modelId: string, from: ExtensionIdentifier, messages: IChatMessage[], options: {
        [name: string]: any;
    }, token: CancellationToken): Promise<ILanguageModelChatResponse>;
    computeTokenLength(modelId: string, message: string | IChatMessage, token: CancellationToken): Promise<number>;
}
