Skip to content

hwj20/auto-config-env

Repository files navigation

auto config env

Demo Video

EN: [VSCode Extension: Let GPT config your python environment.] https://youtu.be/Be3Vl3ay0m0

CN: 【VSCode 插件: 让 GPT 替你配置 python 环境】 https://www.bilibili.com/video/BV156KBzwEjX

IMPORTANT

This plugin uses pip to install packages within a Conda environment, defaulting to the base environment. After the plugin is deployed, please select the corresponding Conda environment or create a new environment from the bottom-right corner.

Features

  1. Complete Imports: Completes imports in a single Python file.
  2. Auto Config: Utilizes a large language model to automatically install Python packages with pip.
  3. Environment Debug(RECOMMENDED): Automatically runs the Python file. If errors occur, the large language model suggests how to set up the environment and executes the returned commands. The debug loop runs up to 3 times.
  4. Generate requirements.txt (Explore Folder). Warning: This operation will generate and replace the requirements.txt file(with a backup of previous one) in the selected folder for .py files in all subdirectories.

Deploy

git clone <repository-url>
cd <project-directory>
npm install 
code .

run it with F5 in vscode.

Requirements

  • OpenAI key (Current model: gpt-3.5-turbo-1106, you can choose prefered model in Settings, but it might lead to errors due to different api.)
  • Conda

Configuration

Open VSCode.

Navigate to File > Preferences > Settings (or press Ctrl + , / Cmd + ,). Search for "auto_config_env" and enter your API key in the input box.

Notes

  • The extension is designed for Ubuntu and not tested on Windows.

Extension Settings

This extension contributes the following settings:

  • "auto_config_env.openaiApiKey": "Your OpenAI Key"
  • "auto_config_env.gpt_model": "gpt-3.5-turbo-1106" or other models(without tests)

Known Issues

Let me know if there's anything else you'd like to add or change!

TODO

Support other LLMs like claude.

Remove reduncdant Tokens and avoid large files.(To save your money hehe)(v1.0.1)

Change the order of ops in menus to prevent mistouching.(v1.1.1)

Auto delete same Imports after "Auto: Install".(But I'm not very sure. Deleting users' contents is a very sensitive operation, although they are redundant.)

About

VSCode Extension: Let GPT config your python environment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published