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

Better Error Handling & Interactive Mode Feature #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

spenceryonce
Copy link

moved openai key to a function call for easier calling

moved openai key to a function call for easier calling
allows for accepting changes of individual suggestions
@spenceryonce spenceryonce changed the title added better error handling Better Error Handling & Interactive Mode Feature Apr 14, 2023
@spenceryonce
Copy link
Author

I've added better error handling and the ability to use interactive mode.

when running the script, you can now use --interactive=True to turn on interactive mode and accept individual suggestions one by one. This increases the likelihood of properly fixing a script without gpt4.

all commands are logged in a log file
with nicely formatted context and datetime
@spenceryonce spenceryonce mentioned this pull request Apr 14, 2023
@spenceryonce
Copy link
Author

Fixed the conflicts

print("\nChanges:")
print_diff(original_file_lines, file_lines)
except Exception as e:
raise Exception(f"Failed to apply changes: {str(e)}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what exceptions were you encountering that caused you to add this? Maybe the response wasn't proper JSON (now fixed)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was getting non-real JSON in the output responses, so it wasn't parsing if I recall correctly.

@biobootloader
Copy link
Owner

I like the idea for interactively selecting changes! Another PR has merged that lets users choose to accept entire changes or not. Let me think about how to best combine this.

@spenceryonce
Copy link
Author

Circling back around to this, been awhile, let me check out the new changes and update you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants