mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-28 23:58:23 +01:00
some comments for concepts
This commit is contained in:
+14
-5
@@ -5,6 +5,7 @@
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
// ChatML
|
||||
export enum ChatMessageRole {
|
||||
System = 0,
|
||||
User = 1,
|
||||
@@ -12,6 +13,7 @@ declare module 'vscode' {
|
||||
Function = 3,
|
||||
}
|
||||
|
||||
// ChatML
|
||||
export class ChatMessage {
|
||||
role: ChatMessageRole;
|
||||
content: string;
|
||||
@@ -20,16 +22,14 @@ declare module 'vscode' {
|
||||
constructor(role: ChatMessageRole, content: string);
|
||||
}
|
||||
|
||||
// TODO: chat response builder
|
||||
export interface ChatResponse {
|
||||
message: ChatMessage;
|
||||
}
|
||||
|
||||
export interface ChatResponseFragment {
|
||||
index: number;
|
||||
part: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a large language model that accepts ChatML messages and produces a streaming response
|
||||
*/
|
||||
export interface ChatResponseProvider {
|
||||
provideChatResponse(messages: ChatMessage[], options: { [name: string]: any }, progress: Progress<ChatResponseFragment>, token: CancellationToken): Thenable<any>;
|
||||
}
|
||||
@@ -40,6 +40,15 @@ declare module 'vscode' {
|
||||
}
|
||||
|
||||
export namespace llm {
|
||||
|
||||
/**
|
||||
* Register a LLM as chat response provider to the editor.
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param provider
|
||||
* @param metadata
|
||||
*/
|
||||
export function registerChatResponseProvider(id: string, provider: ChatResponseProvider, metadata: ChatResponseProviderMetadata): Disposable;
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -5,6 +5,10 @@
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
/**
|
||||
* Represents access to using a chat provider (LLM). Access is granted and temporary, usually only valid
|
||||
* for the duration of an user interaction.
|
||||
*/
|
||||
export interface ChatAccess {
|
||||
|
||||
/**
|
||||
@@ -31,7 +35,7 @@ declare module 'vscode' {
|
||||
*
|
||||
* *Note* that this function will throw an error unless an user interaction is currently active.
|
||||
*
|
||||
* @param id The id of the chat provider, e.g `chatgpt`
|
||||
* @param id The id of the chat provider, e.g `copilot`
|
||||
*/
|
||||
export function requestChatAccess(id: string): Thenable<ChatAccess>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user