From fdbaaa3e84658e2755aef3dd0b9246920a5b446d Mon Sep 17 00:00:00 2001 From: Prayag Shah <34435248+prayagnshah@users.noreply.github.com> Date: Sat, 15 Apr 2023 02:28:13 -0300 Subject: [PATCH] updated the flag --confirm as required - Updated the flag --confirm=True which will allow user to say yes or no before making changes to the file. - If flag is not used then it will right away make changes to the file. - Updated the readme with an example. --- README.md | 8 ++++---- wolverine.py | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 98571ca..6d29bd7 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,14 @@ You can also run with other models, but be warned they may not adhere to the edi python wolverine.py --model=gpt-3.5-turbo buggy_script.py "subtract" 20 3 -You can also use flag `--confirm=True` which will ask you `yes or no` before making changes to the file. If flag is not used then it will apply the changes to the file - - python wolverine.py buggy_script.py "subtract" 20 3 --confirm=True - 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 +You can also use flag `--confirm=True` which will ask you `yes or no` before making changes to the file. If flag is not used then it will apply the changes to the file + + python wolverine.py buggy_script.py "subtract" 20 3 --confirm=True + ## Future Plans This is just a quick prototype I threw together in a few hours. There are many possible extensions and contributions are welcome: diff --git a/wolverine.py b/wolverine.py index 363e3da..dbd77a0 100644 --- a/wolverine.py +++ b/wolverine.py @@ -108,6 +108,8 @@ def send_error_to_gpt(file_path, args, error_message, model=DEFAULT_MODEL): return json_validated_response(model, messages) +# Added the flag -confirm which will ask user before writing changes to file + def apply_changes(file_path, changes: list, confirm=False): """