-
Notifications
You must be signed in to change notification settings - Fork 243
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
Conversation
There was a problem hiding this 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.
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. |
There was a problem hiding this 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
mentat/command/commands/amend.py
Outdated
@classmethod | ||
def help_message(cls) -> str: | ||
return ( | ||
"Removes all context since last user request. Will not undo any edits made." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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." |
Fixes #462. Adds amend command and adds kwarg for having command autocomplete on a prompt.
Pull Request Checklist