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

Implement a :back command to go back to a specific message pair. #107

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

Conversation

filiso
Copy link
Contributor

@filiso filiso commented Jan 21, 2025

  • Implements functionality to go back to a specific message.
  • The footer, which currently includes the conversation cost and the number of tokens, will now display the number (identifier) of each message-pair.
  • A message pair is a user's message followed by the model's response.
  • Typing ':b' or ':back' will undo the last message-pair, including the user's message unlike ':r' which keeps it.
  • Typing ':b X' or ':back X' will go back in the conversation state to message-pair X and confirm it via displaying a string in the console.
  • Going back to X means that X is still part of the conversation with later messages removed.

@@ -63,12 +67,14 @@ def __init__(self, message: str):
COMMAND_QUIT = (":quit", ":q")
COMMAND_RERUN = (":rerun", ":r")
COMMAND_HELP = (":help", ":h", ":?")
COMMAND_BACK_REGEX = r":b(?:ack)? (\d{1,3})"
Copy link
Owner

Choose a reason for hiding this comment

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

any reason to limit to 999 messages?

Suggested change
COMMAND_BACK_REGEX = r":b(?:ack)? (\d{1,3})"
COMMAND_BACK_REGEX = r":b(?:ack)? (\d+)"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, no there is no reason to keep this limit.

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