Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the user to select a model #8

Merged
merged 3 commits into from
Apr 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions wolverine.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run_script(script_name, script_args):
return result.decode("utf-8"), 0


def send_error_to_gpt4(file_path, args, error_message, model):
def send_error_to_gpt(file_path, args, error_message, model):
with open(file_path, "r") as f:
file_lines = f.readlines()

Expand Down Expand Up @@ -115,11 +115,6 @@ def apply_changes(file_path, changes_json):


def main(script_name, *script_args, revert=False, model="gpt-4"):
# if len(sys.argv) < 3:
# print("Usage: python wolverine.py <script_name> <arg1> <arg2> ... [--revert]")
# sys.exit(1)

# Revert changes if requested
if revert:
backup_file = script_name + ".bak"
if os.path.exists(backup_file):
Expand All @@ -144,7 +139,7 @@ def main(script_name, *script_args, revert=False, model="gpt-4"):
cprint("Script crashed. Trying to fix...", "blue")
print("Output:", output)

json_response = send_error_to_gpt4(
json_response = send_error_to_gpt(
file_path=script_name,
args=script_args,
error_message=output,
Expand Down