Skip to content

Commit

Permalink
feat:add status emojis to system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbrayo committed Jan 31, 2025
1 parent e02e119 commit ffa7f04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gptme/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def format_msgs(
userprefix = f"[bold {color}]{userprefix}[/bold {color}]"
if msg.role == "system":
first_line = msg.content.split("\n", 1)[0].lower()
isSuccess = first_line.startswith(("saved", "executed", "ran", "appended", "patch successfully"))
isError = first_line.startswith(("error", "failed","missing arguments", "unknown command", "no patch"))
isSuccess = first_line.startswith(("saved", "appended", "patch successfully"))
isError = first_line.startswith(("error", "failed"))
if isSuccess:
userprefix = f"{userprefix} ✅"
elif isError:
Expand Down
2 changes: 1 addition & 1 deletion gptme/tools/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def execute_patch(
code = kwargs.get("patch", code)

if not code:
yield Message("system", "No patch provided by the assistant")
yield Message("system", "Error: No patch provided by the assistant")
return

yield from execute_with_confirmation(
Expand Down
4 changes: 2 additions & 2 deletions gptme/tools/tmux.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def execute_tmux(
continue

if len(parts) < 2:
yield Message("system", f"Missing arguments for command: {command}")
yield Message("system", f"Error: Missing arguments for command: {command}")
continue

_args = parts[1]
Expand All @@ -237,7 +237,7 @@ def execute_tmux(
elif command == "kill_session":
yield kill_session(_args)
else:
yield Message("system", f"Unknown command: {command}")
yield Message("system", f"Error: Unknown command: {command}")


instructions = """
Expand Down

0 comments on commit ffa7f04

Please sign in to comment.