conda create --env refactor_env
conda activate refactor_env
conda install scipy scikit-learn plotly matplotlib
pip install -r requirements.txt
The initial setup does the following:
- Download a git repository locally
- Find all the python files in the repo and parse them to find all functions
- Generate embeddings for all python functions using OpenAI models.
- Create a Nearest Neighbor Search Index with all the embeddings.
The functionalities supported by the tool includes:
- Search functions using a natural language description (using Embeddings)
- Search functions by exact name. (simple string match)
- Generate a brief explanation of a function. (using GPT3)
- Generate unit tests for a function. (using GPT3)
- Refactor a function to be more compact. (using GPT3)
python main.py