diff --git a/src/memos/api/handlers/chat_handler.py b/src/memos/api/handlers/chat_handler.py index b2c9eb067..2ab60d5de 100644 --- a/src/memos/api/handlers/chat_handler.py +++ b/src/memos/api/handlers/chat_handler.py @@ -536,6 +536,12 @@ def generate_chat_response() -> Generator[str, None, None]: # Step 2: Build system prompt with memories lang = detect_lang(chat_req.query) + if pref_string: + pref_string += ( + "\n# 注意\n- 在思考内容中,不要出现引用序号和id [1,2,3]等标记,否则会导致引用错误。" + if lang == "zh" + else "\n#warning\n- In thinking content, do not appear the reference number and id [1,2,3]etc. otherwise it will cause reference error." + ) system_prompt = self._build_enhance_system_prompt( filtered_memories, pref_string, lang=lang ) diff --git a/src/memos/templates/prefer_complete_prompt.py b/src/memos/templates/prefer_complete_prompt.py index 04f7ea399..3315e061e 100644 --- a/src/memos/templates/prefer_complete_prompt.py +++ b/src/memos/templates/prefer_complete_prompt.py @@ -681,8 +681,6 @@ # Note: Fact memory are summaries of facts, while preference memory are summaries of user preferences. Your response must not violate any of the user's preferences, whether explicit or implicit, and briefly explain why you answer this way to avoid conflicts. -#warning -- In thinking content, do not appear the reference number and id [1,2,3]etc. otherwise it will cause reference error. """ @@ -690,6 +688,4 @@ # 注意: 事实记忆是事实的摘要,而偏好记忆是用户偏好的摘要。 你的回复不得违反用户的任何偏好,无论是显式偏好还是隐式偏好,并简要解释你为什么这样回答以避免冲突。 -# 注意 -- 在思考内容中,不要出现引用序号和id [1,2,3]等标记,否则会导致引用错误。 """