From ceb8654089e180353043c8a109e1455d9548a643 Mon Sep 17 00:00:00 2001 From: Piyush Jain Date: Fri, 12 Apr 2024 09:24:23 -0700 Subject: [PATCH] Backport PR #729: Fixes help slash command. --- 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, + )