Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samk13/rag-code-utils
https://github.com/samk13/rag-code-utils
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/samk13/rag-code-utils
- Owner: Samk13
- License: mit
- Created: 2024-04-27T16:03:32.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-05-05T22:20:09.000Z (8 months ago)
- Last Synced: 2024-05-05T23:26:08.439Z (8 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: CHANGES.md
- License: License
Awesome Lists containing this project
README
![License](https://img.shields.io/github/license/mashape/apistatus.svg)
# RAG Code Utils
## RAG Py Context Miner
This tool is designed to extract the inheritance tree of a specified class and save it in a file. It searches for the class or function within the specified path and the provided virtual environment, extracting the relevant code from the repository. This process enhances the efficiency of RAG applications by providing the essential code context.
The purpose of this tool is to furnish RAG with the minimal code context necessary to deliver accurate responses to queries about code snippets pertaining to the given class, without providing the entire codebase.
## Usage
provide the following variables to the function in `.env` file or as arguments to the script:
* Class or function to extract code for
`TARGET = 'your_target_class_or_function'`* Path to the virtual environment to search for the target class or function
`VENV_PATH = 'path/to/venv'`* Output file to write the extracted code
`OUTPUT_FILE = 'path/to/output/file'`* Path to the repository to search for the target class or function
`REPO_PATH = 'path/to/repo'`You either run the script with the following arguments:
```bash
python main.py -t TARGET -v VENV_PATH -o OUTPUT_FILE -r REPO_PATH
# the following arguments are required: -t/--target, -v/--venv, -o/--output, -r/--repo
```You still can provide the `-t` argument to change your class target.