mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
Merge remote-tracking branch 'origin/main' into dev/bhavyau/tools-model
This commit is contained in:
@@ -80,9 +80,12 @@ declare module 'vscode' {
|
||||
constructor(value: Uri, license: string, snippet: string);
|
||||
}
|
||||
|
||||
export class ChatPrepareToolInvocationPart {
|
||||
toolName: string;
|
||||
constructor(toolName: string);
|
||||
export interface ChatToolInvocationStreamData {
|
||||
/**
|
||||
* Partial or not-yet-validated arguments that have streamed from the language model.
|
||||
* Tools may use this to render interim UI while the full invocation input is collected.
|
||||
*/
|
||||
readonly partialInput?: unknown;
|
||||
}
|
||||
|
||||
export interface ChatTerminalToolInvocationData {
|
||||
@@ -176,7 +179,7 @@ declare module 'vscode' {
|
||||
constructor(uris: Uri[], callback: () => Thenable<unknown>);
|
||||
}
|
||||
|
||||
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatPrepareToolInvocationPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart | ChatResponseExternalEditPart;
|
||||
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart | ChatResponseExternalEditPart;
|
||||
export class ChatResponseWarningPart {
|
||||
value: MarkdownString;
|
||||
constructor(value: string | MarkdownString);
|
||||
@@ -349,7 +352,21 @@ declare module 'vscode' {
|
||||
|
||||
codeCitation(value: Uri, license: string, snippet: string): void;
|
||||
|
||||
prepareToolInvocation(toolName: string): void;
|
||||
/**
|
||||
* Begin a tool invocation in streaming mode. This creates a tool invocation that will
|
||||
* display streaming progress UI until the tool is actually invoked.
|
||||
* @param toolCallId Unique identifier for this tool call, used to correlate streaming updates and final invocation.
|
||||
* @param toolName The name of the tool being invoked.
|
||||
* @param streamData Optional initial streaming data with partial arguments.
|
||||
*/
|
||||
beginToolInvocation(toolCallId: string, toolName: string, streamData?: ChatToolInvocationStreamData): void;
|
||||
|
||||
/**
|
||||
* Update the streaming data for a tool invocation that was started with `beginToolInvocation`.
|
||||
* @param toolCallId The tool call ID that was passed to `beginToolInvocation`.
|
||||
* @param streamData New streaming data with updated partial arguments.
|
||||
*/
|
||||
updateToolInvocation(toolCallId: string, streamData: ChatToolInvocationStreamData): void;
|
||||
|
||||
push(part: ExtendedChatResponsePart): void;
|
||||
|
||||
@@ -668,6 +685,37 @@ declare module 'vscode' {
|
||||
|
||||
export interface LanguageModelToolInvocationOptions<T> {
|
||||
model?: LanguageModelChat;
|
||||
chatStreamToolCallId?: string;
|
||||
}
|
||||
|
||||
export interface LanguageModelToolInvocationStreamOptions<T> {
|
||||
/**
|
||||
* Raw argument payload, such as the streamed JSON fragment from the language model.
|
||||
*/
|
||||
readonly rawInput?: unknown;
|
||||
|
||||
readonly chatRequestId?: string;
|
||||
readonly chatSessionId?: string;
|
||||
readonly chatInteractionId?: string;
|
||||
}
|
||||
|
||||
export interface LanguageModelToolStreamResult {
|
||||
/**
|
||||
* A customized progress message to show while the tool runs.
|
||||
*/
|
||||
invocationMessage?: string | MarkdownString;
|
||||
}
|
||||
|
||||
export interface LanguageModelTool<T> {
|
||||
/**
|
||||
* Called zero or more times before {@link LanguageModelTool.prepareInvocation} while the
|
||||
* language model streams argument data for the invocation. Use this to update progress
|
||||
* or UI with the partial arguments that have been generated so far.
|
||||
*
|
||||
* Implementations must be free of side-effects and should be resilient to receiving
|
||||
* malformed or incomplete input.
|
||||
*/
|
||||
handleToolStream?(options: LanguageModelToolInvocationStreamOptions<T>, token: CancellationToken): ProviderResult<LanguageModelToolStreamResult>;
|
||||
}
|
||||
|
||||
export interface ChatRequest {
|
||||
|
||||
Reference in New Issue
Block a user