-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathmanageTodoListTool.tsx
More file actions
32 lines (27 loc) · 1.46 KB
/
manageTodoListTool.tsx
File metadata and controls
32 lines (27 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type * as vscode from 'vscode';
import { isGpt5PlusFamily } from '../../../platform/endpoint/common/chatModelCapabilities';
import { IChatEndpoint } from '../../../platform/networking/common/networking';
import { ToolName } from '../common/toolNames';
import { ICopilotTool, ToolRegistry } from '../common/toolsRegistry';
/**
* The tool definition and typical description is in core. This just lets us apply a model-specific override.
*/
class ManageTodoListTool implements ICopilotTool<unknown> {
public static readonly toolName = ToolName.CoreManageTodoList;
public static readonly nonDeferred = true;
alternativeDefinition(tool: vscode.LanguageModelToolInformation, endpoint?: IChatEndpoint): vscode.LanguageModelToolInformation {
if (!isGpt5PlusFamily(endpoint)) {
return tool;
}
return {
...tool,
// name: 'update_plan', // Can't update this in a model-specific way yet
description: 'Updates the task plan.\nProvide an optional explanation and a list of plan items, each with a step and status.\nAt most one step can be in_progress at a time.',
};
}
}
ToolRegistry.registerTool(ManageTodoListTool);