Skip to content

Commit e5ac660

Browse files
authored
Remove lm tools (#452)
1 parent 259833a commit e5ac660

File tree

9 files changed

+5
-674
lines changed

9 files changed

+5
-674
lines changed

package.json

Lines changed: 1 addition & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
}
2626
},
2727
"activationEvents": [
28-
"onLanguage:python",
29-
"onLanguageModelTool:get_python_environment_info",
30-
"onLanguageModelTool:get_python_executable_info",
31-
"onLanguageModelTool:install_python_package",
32-
"onLanguageModelTool:create_quick_virtual_environment"
28+
"onLanguage:python"
3329
],
3430
"homepage": "https://github.com/microsoft/vscode-python-environments",
3531
"repository": {
@@ -516,112 +512,6 @@
516512
{
517513
"type": "python"
518514
}
519-
],
520-
"languageModelTools": [
521-
{
522-
"name": "get_python_environment_info",
523-
"displayName": "%python.languageModelTools.get_python_environment_info.displayName%",
524-
"userDescription": "%python.languageModelTools.get_python_environment_info.userDescription%",
525-
"modelDescription": "This tool will retrieve the details of the Python Environment for the specified file or workspace. The details returned include the 1. Type of Environment (conda, venv, etec), 2. Version of Python, 3. List of all installed packages with their versions. ",
526-
"toolReferenceName": "pythonEnvironmentDetails",
527-
"tags": [
528-
"python",
529-
"extension_installed_by_tool"
530-
],
531-
"icon": "$(snake)",
532-
"canBeReferencedInPrompt": true,
533-
"inputSchema": {
534-
"type": "object",
535-
"properties": {
536-
"resourcePath": {
537-
"type": "string"
538-
}
539-
},
540-
"description": "The path to the Python file or workspace to get the environment information for.",
541-
"required": []
542-
}
543-
},
544-
{
545-
"name": "get_python_executable_info",
546-
"displayName": "%python.languageModelTools.get_python_executable.displayName%",
547-
"userDescription": "%python.languageModelTools.get_python_executable.userDescription%",
548-
"modelDescription": "This tool will retrieve the details of the Python Environment for the specified file or workspace. ALWAYS use this tool before executing any Python command in the terminal. This tool returns the details of how to construct the fully qualified path and or command including details such as arguments required to run Python in a terminal. Note: Instead of executing `python --version` or `python -c 'import sys; print(sys.executable)'`, use this tool to get the Python executable path to replace the `python` command. E.g. instead of using `python -c 'import sys; print(sys.executable)'`, use this tool to build the command `conda run -n <env_name> -c 'import sys; print(sys.executable)'`.",
549-
"toolReferenceName": "pythonExecutableDetails",
550-
"tags": [
551-
"python",
552-
"extension_installed_by_tool"
553-
],
554-
"icon": "$(files)",
555-
"canBeReferencedInPrompt": true,
556-
"inputSchema": {
557-
"type": "object",
558-
"properties": {
559-
"resourcePath": {
560-
"type": "string"
561-
}
562-
},
563-
"description": "The path to the Python file or workspace to get the executable information for. If not provided, the current workspace will be used. Where possible pass the path to the file or workspace.",
564-
"required": []
565-
}
566-
},
567-
{
568-
"name": "install_python_package",
569-
"displayName": "%python.languageModelTools.install_python_package.displayName%",
570-
"userDescription": "%python.languageModelTools.install_python_package.userDescription%",
571-
"modelDescription": "Installs Python packages in the given workspace. Use this tool to install packages in the user's chosen environment.",
572-
"toolReferenceName": "installPythonPackage",
573-
"tags": [
574-
"python",
575-
"install python package",
576-
"extension_installed_by_tool"
577-
],
578-
"icon": "$(package)",
579-
"canBeReferencedInPrompt": true,
580-
"inputSchema": {
581-
"type": "object",
582-
"properties": {
583-
"packageList": {
584-
"type": "array",
585-
"items": {
586-
"type": "string"
587-
},
588-
"description": "The list of packages to install."
589-
},
590-
"resourcePath": {
591-
"type": "string",
592-
"description": "The path to the Python file or workspace into which the packages are installed. If not provided, the current workspace will be used. Where possible pass the path to the file or workspace."
593-
}
594-
},
595-
"required": [
596-
"packageList"
597-
]
598-
}
599-
},
600-
{
601-
"name": "create_quick_virtual_environment",
602-
"displayName": "Create a Virtual Environment",
603-
"modelDescription": "This tool will create a Virual Environment",
604-
"tags": [],
605-
"canBeReferencedInPrompt": false,
606-
"inputSchema": {
607-
"type": "object",
608-
"properties": {
609-
"packageList": {
610-
"type": "array",
611-
"items": {
612-
"type": "string"
613-
},
614-
"description": "The list of packages to install."
615-
},
616-
"resourcePath": {
617-
"type": "string",
618-
"description": "The path to the Python file or workspace for which a Python Environment needs to be configured."
619-
}
620-
},
621-
"required": []
622-
},
623-
"when": "false"
624-
}
625515
]
626516
},
627517
"scripts": {

package.nls.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,5 @@
3434
"python-envs.createNewProjectFromTemplate.title": "Create New Project from Template",
3535
"python-envs.terminal.activate.title": "Activate Environment in Current Terminal",
3636
"python-envs.terminal.deactivate.title": "Deactivate Environment in Current Terminal",
37-
"python-envs.uninstallPackage.title": "Uninstall Package",
38-
"python.languageModelTools.get_python_environment_info.displayName": "Get Python Environment Info",
39-
"python.languageModelTools.get_python_environment_info.userDescription": "Get information for a Python Environment, such as Type, Version, Packages, and more.",
40-
"python.languageModelTools.install_python_package.displayName": "Install Python Package",
41-
"python.languageModelTools.install_python_package.userDescription": "Installs Python packages in a Python Environment.",
42-
"python.languageModelTools.get_python_executable.displayName": "Get Python Executable Info",
43-
"python.languageModelTools.get_python_executable.userDescription": "Get executable info for a Python Environment"
44-
}
37+
"python-envs.uninstallPackage.title": "Uninstall Package"
38+
}

src/extension.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { commands, ExtensionContext, LogOutputChannel, Terminal, Uri, window } from 'vscode';
22
import { PythonEnvironment, PythonEnvironmentApi, PythonProjectCreator } from './api';
33
import { ensureCorrectVersion } from './common/extVersion';
4-
import { registerTools } from './common/lm.apis';
54
import { registerLogger, traceError, traceInfo } from './common/logging';
65
import { setPersistentState } from './common/persistentState';
76
import { newProjectSelection } from './common/pickers/managers';
87
import { StopWatch } from './common/stopWatch';
98
import { EventNames } from './common/telemetry/constants';
109
import { sendManagerSelectionTelemetry } from './common/telemetry/helpers';
1110
import { sendTelemetryEvent } from './common/telemetry/sender';
11+
import { createDeferred } from './common/utils/deferred';
1212
import {
1313
activeTerminal,
1414
createLogOutputChannel,
@@ -64,16 +64,11 @@ import { PythonStatusBarImpl } from './features/views/pythonStatusBar';
6464
import { updateViewsAndStatus } from './features/views/revealHandler';
6565
import { EnvironmentManagers, ProjectCreators, PythonProjectManager } from './internal.api';
6666
import { registerSystemPythonFeatures } from './managers/builtin/main';
67+
import { SysPythonManager } from './managers/builtin/sysPythonManager';
6768
import { createNativePythonFinder, NativePythonFinder } from './managers/common/nativePythonFinder';
6869
import { registerCondaFeatures } from './managers/conda/main';
6970
import { registerPoetryFeatures } from './managers/poetry/main';
7071
import { registerPyenvFeatures } from './managers/pyenv/main';
71-
import { GetEnvironmentInfoTool } from './features/chat/getEnvInfoTool';
72-
import { GetExecutableTool } from './features/chat/getExecutableTool';
73-
import { InstallPackageTool } from './features/chat/installPackagesTool';
74-
import { CreateQuickVirtualEnvironmentTool } from './features/chat/createQuickVenvTool';
75-
import { createDeferred } from './common/utils/deferred';
76-
import { SysPythonManager } from './managers/builtin/sysPythonManager';
7772

7873
export async function activate(context: ExtensionContext): Promise<PythonEnvironmentApi> {
7974
const start = new StopWatch();
@@ -148,19 +143,6 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
148143
context.subscriptions.push(
149144
shellStartupVarsMgr,
150145
registerCompletionProvider(envManagers),
151-
registerTools(
152-
CreateQuickVirtualEnvironmentTool.toolName,
153-
new CreateQuickVirtualEnvironmentTool(
154-
api,
155-
envManagers,
156-
projectManager,
157-
sysPythonManager.promise,
158-
outputChannel,
159-
),
160-
),
161-
registerTools(GetEnvironmentInfoTool.toolName, new GetEnvironmentInfoTool(api, envManagers)),
162-
registerTools(GetExecutableTool.toolName, new GetExecutableTool(api, envManagers)),
163-
registerTools(InstallPackageTool.toolName, new InstallPackageTool(api)),
164146
commands.registerCommand('python-envs.terminal.revertStartupScriptChanges', async () => {
165147
await cleanupStartupScripts(shellStartupProviders);
166148
}),

src/features/chat/createQuickVenvTool.ts

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/features/chat/getEnvInfoTool.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)