ai-python-wolverine/README.md

50 wiersze
1.9 KiB
Markdown
Czysty Zwykły widok Historia

2023-03-18 22:16:47 +00:00
# Wolverine
## About
Give your python scripts regenerative healing abilities!
Run your scripts with Wolverine and when they crash, GPT-4 edits them and explains what went wrong. Even if you have many bugs it will repeatedly rerun until it's fixed.
For a quick demonstration see my [demo video on twitter](https://twitter.com/bio_bootloader/status/1636880208304431104).
## Setup
python3 -m venv venv
source venv/bin/activate
2023-04-08 20:10:04 +00:00
pip install -r requirements.txt
2023-04-12 17:45:54 +00:00
cp .env.sample .env
2023-03-18 22:16:47 +00:00
2023-04-14 21:46:18 +00:00
Add your openAI api key to `.env`
2023-04-12 17:45:54 +00:00
2023-04-14 21:46:18 +00:00
_warning!_ by default this uses GPT-4 and may make many repeated calls to the api.
2023-03-18 22:16:47 +00:00
## Example Usage
To run with gpt-4 (the default, tested option):
2023-03-18 22:16:47 +00:00
python wolverine.py buggy_script.py "subtract" 20 3
You can also run with other models, but be warned they may not adhere to the edit format as well:
python wolverine.py --model=gpt-3.5-turbo buggy_script.py "subtract" 20 3
2023-04-14 21:46:18 +00:00
If you want to use GPT-3.5 by default instead of GPT-4 uncomment the default model line in `.env`:
DEFAULT_MODEL=gpt-3.5-turbo
2023-03-18 22:16:47 +00:00
## Future Plans
This is just a quick prototype I threw together in a few hours. There are many possible extensions and contributions are welcome:
- add flags to customize usage, such as asking for user confirmation before running changed code
2023-03-18 22:16:47 +00:00
- further iterations on the edit format that GPT responds in. Currently it struggles a bit with indentation, but I'm sure that can be improved
- a suite of example buggy files that we can test prompts on to ensure reliability and measure improvement
2023-03-18 22:16:47 +00:00
- multiple files / codebases: send GPT everything that appears in the stacktrace
- graceful handling of large files - should we just send GPT relevant classes / functions?
- extension to languages other than python
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=biobootloader/wolverine&type=Date)](https://star-history.com/#biobootloader/wolverine)