mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
feat: add new conversation command and enhance command handling
- Introduced the `/new` command to start a new conversation, resetting the history. - Updated command handling in the CLI and various platform adapters (Discord, Slack, Telegram) to support the new command. - Added help command functionality to list available commands, improving user guidance. - Enhanced command mapping for better integration across platforms, ensuring consistent command behavior.
This commit is contained in:
parent
53e13fe1f1
commit
3191a9ba11
5 changed files with 217 additions and 8 deletions
|
|
@ -327,13 +327,19 @@ class SlackAdapter(BasePlatformAdapter):
|
|||
user_id = command.get("user_id", "")
|
||||
channel_id = command.get("channel_id", "")
|
||||
|
||||
# Map common slash subcommands to gateway commands
|
||||
if text in ("new", "reset"):
|
||||
text = "/reset"
|
||||
elif text == "status":
|
||||
text = "/status"
|
||||
elif text == "stop":
|
||||
text = "/stop"
|
||||
# Map subcommands to gateway commands
|
||||
subcommand_map = {
|
||||
"new": "/reset", "reset": "/reset",
|
||||
"status": "/status", "stop": "/stop",
|
||||
"help": "/help",
|
||||
"model": "/model", "personality": "/personality",
|
||||
"retry": "/retry", "undo": "/undo",
|
||||
}
|
||||
first_word = text.split()[0] if text else ""
|
||||
if first_word in subcommand_map:
|
||||
# Preserve arguments after the subcommand
|
||||
rest = text[len(first_word):].strip()
|
||||
text = f"{subcommand_map[first_word]} {rest}".strip() if rest else subcommand_map[first_word]
|
||||
elif text:
|
||||
pass # Treat as a regular question
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue