Skip to content

Commit

Permalink
fix: removed /continue and /load commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 31, 2023
1 parent fae0320 commit 9ba41f5
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions gptme/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
logger = logging.getLogger(__name__)

Actions = Literal[
"continue",
"summarize",
"log",
"edit",
"rename",
"fork",
"summarize",
"context",
"load",
"save",
"shell",
"python",
Expand All @@ -41,18 +39,16 @@
]

action_descriptions: dict[Actions, str] = {
"continue": "Continue response",
"undo": "Undo the last action",
"log": "Show the conversation log",
"edit": "Edit previous messages",
"edit": "Edit the conversation in your editor",
"rename": "Rename the conversation",
"fork": "Create a copy of the conversation with a new name",
"summarize": "Summarize the conversation so far",
"load": "Load a file",
"save": "Save the most recent code block to a file",
"shell": "Execute a shell command",
"python": "Execute a Python command",
"replay": "Re-execute past commands in the conversation (does not store output in log)",
"summarize": "Summarize the conversation",
"save": "Save the last code block to a file",
"shell": "Execute shell code",
"python": "Execute Python code",
"replay": "Re-execute codeblocks in the conversation, wont store output in log",
"impersonate": "Impersonate the assistant",
"help": "Show this help message",
"exit": "Exit the program",
Expand Down Expand Up @@ -85,9 +81,6 @@ def handle_cmd(
yield from execute_shell(" ".join(args), ask=not no_confirm)
case "python" | "py":
yield from execute_python(" ".join(args), ask=not no_confirm)
case "continue":
# undo '/continue' command
log.undo(1, quiet=True)
case "log":
log.undo(1, quiet=True)
log.print(show_hidden="--hidden" in args)
Expand Down Expand Up @@ -151,12 +144,6 @@ def handle_cmd(
# if int, undo n messages
n = int(args[0]) if args and args[0].isdigit() else 1
log.undo(n)
case "load":
# TODO: replace with automatic loading of any paths in prompt?
filename = args[0] if args else input("Filename: ")
with open(filename) as f:
contents = f.read()
yield Message("system", f"```{filename}\n{contents}\n```")
case "save":
# undo
log.undo(1, quiet=True)
Expand Down

0 comments on commit 9ba41f5

Please sign in to comment.