You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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.",
"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.",
"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.",
packageList?: string[];// Added only becausewe have ability to create a virtual env with list of packages same tool within the in Python Env extension.
@@ -66,7 +69,7 @@ export class CreateVirtualEnvTool implements LanguageModelTool<ICreateVirtualEnv
@@ -56,14 +57,33 @@ export class GetEnvironmentInfoTool implements LanguageModelTool<IResourceRefere
56
57
if(!environment||!environment.version){
57
58
thrownewError('No environment found for the provided resource path: '+resourcePath?.fsPath);
58
59
}
59
-
constpackages=awaitgetPythonPackagesResponse(
60
-
environment,
61
-
this.pythonExecFactory,
62
-
this.processServiceFactory,
63
-
resourcePath,
64
-
token,
65
-
);
66
60
61
+
letpackages='';
62
+
if(useEnvExtension()){
63
+
constapi=awaitgetEnvExtApi();
64
+
constenv=awaitapi.getEnvironment(resourcePath);
65
+
constpkgs=env ? awaitapi.getPackages(env) : [];
66
+
if(pkgs&&pkgs.length>0){
67
+
// Installed Python packages, each in the format <name> or <name> (<version>). The version may be omitted if unknown. Returns an empty array if no packages are installed.
68
+
constresponse=[
69
+
'Below is a list of the Python packages, each in the format <name> or <name> (<version>). The version may be omitted if unknown: ',
0 commit comments