Skip to content

Commit df612ac

Browse files
authored
Remove 'name' on tool result part, and fix note about PromptElement tool results (microsoft#226500)
* Remove 'name' on tool result part, and fix note about PromptElement tool results * More names
1 parent b967cdd commit df612ac

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/vs/workbench/api/common/extHostTypeConverters.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,7 @@ export namespace LanguageModelChatMessage {
23172317
if (c.type === 'text') {
23182318
return c.value;
23192319
} else {
2320-
return new types.LanguageModelToolResultPart(c.name, c.name, c.value, c.isError);
2320+
return new types.LanguageModelToolResultPart(c.toolCallId, c.value, c.isError);
23212321
}
23222322
});
23232323
const content = content2.find(c => typeof c === 'string') ?? '';
@@ -2336,7 +2336,6 @@ export namespace LanguageModelChatMessage {
23362336
if (message.content2 instanceof types.LanguageModelToolResultPart) {
23372337
return {
23382338
type: 'tool_result',
2339-
name: message.content2.name,
23402339
toolCallId: message.content2.toolCallId,
23412340
value: message.content2.content,
23422341
isError: message.content2.isError

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4559,13 +4559,11 @@ export enum LanguageModelChatMessageRole {
45594559

45604560
export class LanguageModelToolResultPart implements vscode.LanguageModelChatMessageToolResultPart {
45614561

4562-
name: string;
45634562
toolCallId: string;
45644563
content: string;
45654564
isError: boolean;
45664565

4567-
constructor(name: string, toolCallId: string, content: string, isError?: boolean) {
4568-
this.name = name;
4566+
constructor(toolCallId: string, content: string, isError?: boolean) {
45694567
this.toolCallId = toolCallId;
45704568
this.content = content;
45714569
this.isError = isError ?? false;

src/vs/workbench/contrib/chat/common/languageModels.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export interface IChatMessageTextPart {
2929

3030
export interface IChatMessageToolResultPart {
3131
type: 'tool_result';
32-
name: string;
3332
toolCallId: string;
3433
value: any;
3534
isError?: boolean;

src/vscode-dts/vscode.proposed.lmTools.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ declare module 'vscode' {
5252

5353
// USER -> LM: the result of a function call
5454
export class LanguageModelChatMessageToolResultPart {
55-
name: string;
5655
toolCallId: string;
5756
content: string;
5857
isError: boolean;
5958

60-
constructor(name: string, toolCallId: string, content: string, isError?: boolean);
59+
constructor(toolCallId: string, content: string, isError?: boolean);
6160
}
6261

6362
export interface LanguageModelChatMessage {
@@ -74,7 +73,7 @@ declare module 'vscode' {
7473

7574
export interface LanguageModelToolResult {
7675
/**
77-
* The result can contain arbitrary representations of the content. An example might be 'prompt-tsx' to indicate an element that can be rendered with the @vscode/prompt-tsx library.
76+
* The result can contain arbitrary representations of the content. An example might be a `PromptElementJSON` from `@vscode/prompt-tsx`, using the `contentType` exported by that library.
7877
*/
7978
[contentType: string]: any;
8079

0 commit comments

Comments
 (0)