remove extraneous tool selection

This commit is contained in:
amunger
2024-10-08 15:00:30 -07:00
parent 744bf754cb
commit 56f8d1cd05
2 changed files with 3 additions and 12 deletions

View File

@ -1,11 +1,11 @@
{
"name": "chat-tool-sample",
"name": "chat-tools-sample",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "chat-tool-sample",
"name": "chat-tools-sample",
"version": "0.1.0",
"devDependencies": {
"@types/node": "^20.5.9",

View File

@ -45,6 +45,7 @@ function registerChatParticipant(context: vscode.ExtensionContext) {
const options: vscode.LanguageModelChatRequestOptions = {
justification: 'Just because!',
tools: allTools
};
const messages = [
@ -56,17 +57,7 @@ function registerChatParticipant(context: vscode.ExtensionContext) {
}
messages.push(vscode.LanguageModelChatMessage.User(request.prompt));
const toolReferences = [...request.toolReferences];
const runWithFunctions = async (): Promise<void> => {
const requestedTool = toolReferences.shift();
if (requestedTool) {
options.toolChoice = requestedTool.id;
options.tools = allTools.filter(tool => tool.name === requestedTool.id);
} else {
options.toolChoice = undefined;
options.tools = allTools;
}
const toolCalls: IToolCall[] = [];
const response = await model.sendRequest(messages, options, token);