api: some slight lmtools polish (#226371)

- Have `countTokens` only take a string for now, since that's all that
  tool elements in tsx should currently omit (not chat messages with
	roles.) String counting is a much easier interface to satisfy.
- Joyce pointed out that it's "invocation" not "invokation", for reasons
  unfathomable to me. I will open an issue with the English language.
This commit is contained in:
Connor Peet
2024-08-22 22:16:02 -07:00
committed by GitHub
parent 1a1ec33222
commit aca1518b48
7 changed files with 33 additions and 36 deletions

View File

@@ -1489,7 +1489,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
checkProposedApiEnabled(extension, 'lmTools');
return extHostLanguageModelTools.registerTool(extension, toolId, tool);
},
invokeTool(toolId: string, parameters: vscode.LanguageModelToolInvokationOptions, token: vscode.CancellationToken) {
invokeTool(toolId: string, parameters: vscode.LanguageModelToolInvocationOptions, token: vscode.CancellationToken) {
checkProposedApiEnabled(extension, 'lmTools');
return extHostLanguageModelTools.invokeTool(toolId, parameters, token);
},