diff --git a/source/lambda/online/common_logic/common_utils/prompt_utils.py b/source/lambda/online/common_logic/common_utils/prompt_utils.py index 25f81c0a..14024f70 100644 --- a/source/lambda/online/common_logic/common_utils/prompt_utils.py +++ b/source/lambda/online/common_logic/common_utils/prompt_utils.py @@ -128,6 +128,7 @@ def prompt_template_render(self, prompt_template: dict): CLAUDE_RAG_SYSTEM_PROMPT = """You are a customer service agent, and answering user's query. You ALWAYS follow these response rules when writing your response: +- 如果 里面的内容包含markdown格式的图片,如 ![image](https://www.demo.com/demo.png),请保留这个markdown格式的图片,并将他原封不动的输出到回答内容的最后,注意:不要修改这个markdown格式的图片. - NERVER say "根据搜索结果/大家好/谢谢/根据这个文档...". - 回答简单明了 - 如果问题与 里面的内容不相关,直接回答 "根据内部知识库,找不到相关内容。" diff --git a/source/portal/src/pages/chatbot/ChatBot.tsx b/source/portal/src/pages/chatbot/ChatBot.tsx index 5b9ee02c..b91ed85b 100644 --- a/source/portal/src/pages/chatbot/ChatBot.tsx +++ b/source/portal/src/pages/chatbot/ChatBot.tsx @@ -176,11 +176,11 @@ const ChatBot: React.FC = (props: ChatBotProps) => { sessionMessage.map((msg) => { let messageContent = msg.content; // Handle AI images message - // if (msg.role === 'ai' && msg.additional_kwargs?.figure?.length > 0) { - // msg.additional_kwargs.figure.forEach((item) => { - // messageContent += ` \n ![${item.content_type}](/${encodeURIComponent(item.figure_path)})`; - // }); - // } + if (msg.role === 'ai' && msg.additional_kwargs?.figure?.length > 0) { + msg.additional_kwargs.figure.forEach((item) => { + messageContent += ` \n ![${item.content_type}](/${encodeURIComponent(item.figure_path)})`; + }); + } return { type: msg.role, message: {