Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonGetPackages Tool, TPI #139

Closed
3 tasks done
eleanorjboyd opened this issue Jan 27, 2025 · 6 comments
Closed
3 tasks done

pythonGetPackages Tool, TPI #139

eleanorjboyd opened this issue Jan 27, 2025 · 6 comments

Comments

@eleanorjboyd
Copy link
Member

eleanorjboyd commented Jan 27, 2025

Refs: #135

Complexity: 3

Author: @eleanorjboyd

Create Issue

Create Issue


  1. install the vscode-python-environments extension pre-release & pre-release vscode-python extension.
  2. open / create a python file
  3. call #pythonGetPackages tool in the chat window
  4. check to see if you get the results you expect, make sure packages returned also have versions
  5. try some of the follow for the results you expect
    • create environment and select it for your workspace
    • install a package
    • delete a package
    • change the version of a package
Image
@joyceerhl
Copy link

I have 0.1.2025012401 of the Python environments extension and am not seeing a tool show up in chat input completions, is there a setting I need to add?

@karthiknadig
Copy link
Member

@joyceerhl I just started a build that includes this feature.

@DonJayamanne
Copy link

@karthiknadig @anthonykim1 Might need a Python extension build as well for microsoft/vscode-python#24747 (comment). the last release was from 24th, and there seems to be changes related to that issue 6 hours ago,

@isidorn
Copy link

isidorn commented Jan 28, 2025

#pythonGetPackages was not working well for me. Most of the time, it refused to give me useful info as I tried to capture in #141

Do we envision users using this tool, or is this tool designed to help agents?
For both - we should figure out what scenarios actually make sense. When would a user want to use this tool, instead of just asking Copilot.
As a tool for an agent I think it makes more sense, but would like to hear @roblourens thoughts on usefulnes of "getting python packages" as a tool for an agent. As opposed to the agent reading the requirements.txt file.

@isidorn isidorn removed their assignment Jan 28, 2025
@karthiknadig
Copy link
Member

@isidorn This tools is intended for Agents as you identified. The intent of the tool is to provide packages regardless of the type of environment/package manager/lock-file used.

requirements.txt is not available for a lot of projects. venv does not add a requirements file on creation and pip does not update it on install. Environments created using environment managers like conda don't use requriements.txt. Another thing is depending on environment manager the environment itself may be in global location. Lastly .env files or PYTHONPATH can be changed to include packages that are outside of the environment (commonly used in embedded python cases, blender, maya , adobe etc ). This means that how packages in a workspace are determined is varies by each case. This tool handles that for you.

The information provided includes version info. This is especially useful when projects are bound to a particular version of a package, in embedded python cases (particular version of blender or maya), and when working on projects with older frameworks (say django 3 vs 4). Or when using specific variants for perf like pandas vs polars.

@isidorn
Copy link

isidorn commented Jan 28, 2025

@karthiknadig thanks for providing clarity.
Then you can consider to hide it from the UI for now (that should be a boolean flag when registering a tool). Users using this tool leads to weird experiences from my experience.

And we can re-assess the tool (explanation, parameters) in February when we look into 3rd party tools usage by agent mode.

I would love to see some scenarios where agent performs better with the access of this tool, compared to without.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants