Path: blob/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts
3290 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45// version: 467declare module 'vscode' {89/**10* The provider version of {@linkcode LanguageModelChatRequestOptions}11*/12export interface ProvideLanguageModelChatResponseOptions {1314/**15* What extension initiated the request to the language model16*/17readonly requestInitiator: string;18}1920/**21* All the information representing a single language model contributed by a {@linkcode LanguageModelChatProvider}.22*/23export interface LanguageModelChatInformation {2425/**26* When present, this gates the use of `requestLanguageModelAccess` behind an authorization flow where27* the user must approve of another extension accessing the models contributed by this extension.28* Additionally, the extension can provide a label that will be shown in the UI.29* A common example of a label is an account name that is signed in.30*31*/32requiresAuthorization?: true | { label: string };3334/**35* Whether or not this will be selected by default in the model picker36* NOT BEING FINALIZED37*/38readonly isDefault?: boolean;3940/**41* Whether or not the model will show up in the model picker immediately upon being made known via {@linkcode LanguageModelChatProvider.provideLanguageModelChatInformation}.42* NOT BEING FINALIZED43*/44readonly isUserSelectable?: boolean;4546/**47* Optional category to group models by in the model picker.48* The lower the order, the higher the category appears in the list.49* Has no effect if `isUserSelectable` is `false`.50*51* WONT BE FINALIZED52*/53readonly category?: { label: string; order: number };5455readonly statusIcon?: ThemeIcon;56}5758export type LanguageModelResponsePart2 = LanguageModelResponsePart | LanguageModelDataPart | LanguageModelThinkingPart;5960export interface LanguageModelChatProvider<T extends LanguageModelChatInformation = LanguageModelChatInformation> {61provideLanguageModelChatResponse(model: T, messages: readonly LanguageModelChatRequestMessage[], options: ProvideLanguageModelChatResponseOptions, progress: Progress<LanguageModelResponsePart2>, token: CancellationToken): Thenable<void>;62}63}646566