From a11b5293fbe535fb87019fac6de087550b3de511 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Wed, 23 Oct 2024 21:45:17 -0700 Subject: [PATCH] Add uploaded images to research mode, code slash command, include code references --- .../components/chatMessage/chatMessage.tsx | 3 +++ src/khoj/routers/api_chat.py | 25 ++++++++++--------- src/khoj/routers/helpers.py | 2 ++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/interface/web/app/components/chatMessage/chatMessage.tsx b/src/interface/web/app/components/chatMessage/chatMessage.tsx index 85bcc517..1c7757b4 100644 --- a/src/interface/web/app/components/chatMessage/chatMessage.tsx +++ b/src/interface/web/app/components/chatMessage/chatMessage.tsx @@ -301,6 +301,9 @@ export function TrainOfThought(props: TrainOfThoughtProps) { const iconColor = props.primary ? convertColorToTextClass(props.agentColor) : "text-gray-500"; const icon = chooseIconFromHeader(header, iconColor); let markdownRendered = DOMPurify.sanitize(md.render(props.message)); + + // Remove any header tags from markdownRendered + markdownRendered = markdownRendered.replace(//g, ""); return (
Conver return ConversationCommand.Summarize elif query.startswith("/diagram"): return ConversationCommand.Diagram + elif query.startswith("/code"): + return ConversationCommand.Code # If no relevant notes found for the given query elif not any_references: return ConversationCommand.General