Skip to content

Commit 0c5521c

Browse files
committed
wip
1 parent b890f41 commit 0c5521c

File tree

9 files changed

+547
-43
lines changed

9 files changed

+547
-43
lines changed

package.json

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,23 +1464,52 @@
14641464
}
14651465
],
14661466
"languageModelTools": [
1467+
{
1468+
"name": "configure_python_environment",
1469+
"displayName": "Configure Python Environment",
1470+
"modelDescription": "This tool configures a Python environment in the given workspace. ALWAYS Use this tool to set up the user's chosen environment and ALWAYS call this tool before using any other Python related tools.",
1471+
"userDescription": "%python.languageModelTools.configure_python_environment.userDescription%",
1472+
"toolReferenceName": "configurePythonEnvironment",
1473+
"tags": [
1474+
"ms-python.python"
1475+
],
1476+
"icon": "$(files)",
1477+
"canBeReferencedInPrompt": true,
1478+
"inputSchema": {
1479+
"type": "object",
1480+
"properties": {
1481+
"resourcePath": {
1482+
"type": "string",
1483+
"description": "The path to the Python file or workspace for which a Python Environment needs to be configured."
1484+
},
1485+
"option": {
1486+
"type": "string",
1487+
"description": "List of valid values will only be provided by calling this tool at least once for a resourcePath. Each call to this tool could result in different values that are acceptable for this."
1488+
}
1489+
},
1490+
"required": []
1491+
},
1492+
"when": "!pythonEnvExtensionInstalled"
1493+
},
14671494
{
14681495
"name": "get_python_environment_details",
14691496
"displayName": "Get Python Environment Info",
14701497
"userDescription": "%python.languageModelTools.get_python_environment_details.userDescription%",
1471-
"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. ",
1498+
"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. ALWAYS call configure_python_environment before using this tool.",
14721499
"toolReferenceName": "pythonGetEnvironmentInfo",
1473-
"tags": [],
1500+
"tags": [
1501+
"enable_other_tool_configure_python_environment"
1502+
],
14741503
"icon": "$(files)",
14751504
"canBeReferencedInPrompt": true,
14761505
"inputSchema": {
14771506
"type": "object",
14781507
"properties": {
14791508
"resourcePath": {
1480-
"type": "string"
1509+
"type": "string",
1510+
"description": "The path to the Python file or workspace to get the environment information for."
14811511
}
14821512
},
1483-
"description": "The path to the Python file or workspace to get the environment information for.",
14841513
"required": []
14851514
},
14861515
"when": "!pythonEnvExtensionInstalled"
@@ -1489,19 +1518,21 @@
14891518
"name": "get_python_executable_details",
14901519
"displayName": "Get Python Executable",
14911520
"userDescription": "%python.languageModelTools.get_python_executable_details.userDescription%",
1492-
"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)'`.",
1521+
"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)'`. ALWAYS call configure_python_environment before using this tool.",
14931522
"toolReferenceName": "pythonExecutableCommand",
1494-
"tags": [],
1523+
"tags": [
1524+
"enable_other_tool_configure_python_environment"
1525+
],
14951526
"icon": "$(snake)",
14961527
"canBeReferencedInPrompt": true,
14971528
"inputSchema": {
14981529
"type": "object",
14991530
"properties": {
15001531
"resourcePath": {
1501-
"type": "string"
1532+
"type": "string",
1533+
"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."
15021534
}
15031535
},
1504-
"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.",
15051536
"required": []
15061537
},
15071538
"when": "!pythonEnvExtensionInstalled"
@@ -1510,7 +1541,7 @@
15101541
"name": "install_python_packages",
15111542
"displayName": "Install Python Package",
15121543
"userDescription": "%python.languageModelTools.install_python_packages.userDescription%",
1513-
"modelDescription": "Installs Python packages in the given workspace. Use this tool to install packages in the user's chosen environment.",
1544+
"modelDescription": "Installs Python packages in the given workspace. Use this tool to install packages in the user's chosen environment. ALWAYS call configure_python_environment before using this tool.",
15141545
"toolReferenceName": "pythonInstallPackage",
15151546
"tags": [],
15161547
"icon": "$(package)",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"python.languageModelTools.get_python_environment_details.userDescription": "Get information for a Python Environment, such as Type, Version, Packages, and more.",
44
"python.languageModelTools.install_python_packages.userDescription": "Installs Python packages in a Python Environment.",
55
"python.languageModelTools.get_python_executable_details.userDescription": "Get executable info for a Python Environment",
6+
"python.languageModelTools.configure_python_environment.userDescription": "Configure a Python Environment for a workspace",
67
"python.command.python.startNativeREPL.title": "Start Native Python REPL",
78
"python.command.python.createEnvironment.title": "Create Environment...",
89
"python.command.python.createNewFile.title": "New Python File",

0 commit comments

Comments
 (0)