Skip to content

Commit 35bc424

Browse files
Wang-Daojiyuan.wangfridayLCaralHsi
authored
Feat/fix palyground bug (#710)
* fix playground bug, internet search judge * fix playground internet bug * modify delete mem * modify tool resp bug in multi cube * fix bug in playground chat handle and search inter * modify prompt * fix bug in playground * fix bug playfround * fix bug * fix code * fix model bug in playground * modify plan b * llm param modify * add logger in playground * modify code * fix bug * modify code * modify code * fix bug * fix search bug in plarground * fixx bug * move schadualr to back * modify pref location * modify fast net search * add tags and new package * modify prompt fix bug * remove nltk due to image promblem * prompt modify * modify bug remove redundant field * modify bug * fix playground bug * fix bug * bust internet topk * bust to 50 * fix bug cite * modify search * remote query add in playground * modify bug * modify pref bug --------- Co-authored-by: yuan.wang <[email protected]> Co-authored-by: chunyu li <[email protected]> Co-authored-by: CaralHsi <[email protected]>
1 parent 4338bd9 commit 35bc424

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/memos/api/handlers/chat_handler.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,12 @@ def generate_chat_response() -> Generator[str, None, None]:
536536

537537
# Step 2: Build system prompt with memories
538538
lang = detect_lang(chat_req.query)
539+
if pref_string:
540+
pref_string += (
541+
"\n# 注意\n- 在思考内容中,不要出现引用序号和id [1,2,3]等标记,否则会导致引用错误。"
542+
if lang == "zh"
543+
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."
544+
)
539545
system_prompt = self._build_enhance_system_prompt(
540546
filtered_memories, pref_string, lang=lang
541547
)

src/memos/templates/prefer_complete_prompt.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,15 +681,11 @@
681681
# Note:
682682
Fact memory are summaries of facts, while preference memory are summaries of user preferences.
683683
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.
684-
#warning
685-
- In thinking content, do not appear the reference number and id [1,2,3]etc. otherwise it will cause reference error.
686684
"""
687685

688686

689687
PREF_INSTRUCTIONS_ZH = """
690688
# 注意:
691689
事实记忆是事实的摘要,而偏好记忆是用户偏好的摘要。
692690
你的回复不得违反用户的任何偏好,无论是显式偏好还是隐式偏好,并简要解释你为什么这样回答以避免冲突。
693-
# 注意
694-
- 在思考内容中,不要出现引用序号和id [1,2,3]等标记,否则会导致引用错误。
695691
"""

0 commit comments

Comments
 (0)