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

add amend command, allow non command autocompleted prompts #466

Merged
merged 4 commits into from
Jan 12, 2024

Conversation

PCSwingle
Copy link
Member

Fixes #462. Adds amend command and adds kwarg for having command autocomplete on a prompt.

Pull Request Checklist

  • Documentation has been updated, or this change doesn't require that

Copy link
Member

@granawkins granawkins left a comment

Choose a reason for hiding this comment

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

LGTM - performs as expected and really useful to have.

1 question: I couldn't parse exactly when/why command_autocomplete would be False?

1 comment: In the future I wonder if it'd make sense to build our own wrapper around the ChatCompletionMessage, which could include a get_text_content method, and also track message metadata for history/sampler like the latest commitID, the git diff since the last user message (this would simplify undo a lot), etc. Could also have a single .create classmethod that selects the right OAI class based on role, which would save a ton of imports.

@PCSwingle
Copy link
Member Author

We don't want it to be true when asking y/n questions, when asking y/n/i, etc. We only want it to be true when we're actually checking for commands.

Copy link
Member

@biobootloader biobootloader left a comment

Choose a reason for hiding this comment

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

Nice, works well!

Before merging make sure to update docs/source/user/commands.rst

@classmethod
def help_message(cls) -> str:
return (
"Removes all context since last user request. Will not undo any edits made."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Removes all context since last user request. Will not undo any edits made."
"Used to amend a previous user request. Works by reseting context to the state it was at the last request and prefills user input with the last request. Does not undo any edits."

@PCSwingle PCSwingle merged commit cc37ea2 into main Jan 12, 2024
16 checks passed
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.

Add new command: /retry or /amend
3 participants