From 4d77b00028b62f2e850d627319182df15e1a09f9 Mon Sep 17 00:00:00 2001 From: "Lumberbot (aka Jack)" <39504233+meeseeksmachine@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:19:05 +0200 Subject: [PATCH] Backport PR #729: Fixes help slash command. (#743) Co-authored-by: Piyush Jain --- packages/jupyter-ai/jupyter_ai/chat_handlers/help.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/help.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/help.py index e46038da5..383076c52 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/help.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/help.py @@ -62,4 +62,14 @@ def __init__(self, *args, chat_handlers: Dict[str, BaseChatHandler], **kwargs): self._chat_handlers = chat_handlers async def process_message(self, message: HumanChatMessage): - self.reply(_format_help_message(self._chat_handlers), message) + persona = self.config_manager.persona + lm_provider = self.config_manager.lm_provider + unsupported_slash_commands = ( + lm_provider.unsupported_slash_commands if lm_provider else set() + ) + self.reply( + _format_help_message( + self._chat_handlers, persona, unsupported_slash_commands + ), + message, + )