Skip to content

Commit f3c43b4

Browse files
committed
fix: context pack prompt
1 parent 0316e80 commit f3c43b4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/server/api/memobase_server/controllers/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def get_user_context(
112112
if not p.ok():
113113
return p
114114
user_events = p.data()
115-
event_section = "\n---\n".join([event_str_repr(ed) for ed in user_events.events])
115+
event_section = "\n".join([event_str_repr(ed) for ed in user_events.events])
116116
event_section_tokens = len(get_encoded_tokens(event_section))
117117
LOG.info(
118118
f"Retrived {len(use_profiles)} profiles({profile_section_tokens} tokens), {len(user_events.events)} events({event_section_tokens} tokens)"

src/server/api/memobase_server/prompts/chat_context_pack.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,25 @@
66
def en_context_prompt(profile_section: str, event_section: str) -> str:
77
return f"""---
88
# Memory
9+
Unless the user has relevant queries, do not actively mention those memories in the conversation.
910
## User Background:
1011
{profile_section}
1112
1213
## Latest Events:
1314
{event_section}
14-
15-
Unless the user has relevant queries, do not actively mention those memories in the conversation.
1615
---
1716
"""
1817

1918

2019
def zh_context_prompt(profile_section: str, event_section: str) -> str:
2120
return f"""---
2221
# 记忆
22+
除非用户有相关的需求,否则不要主动在对话中提到这些记忆.
2323
## 用户背景:
2424
{profile_section}
2525
26-
## 部分过去事件
26+
## 过去事件
2727
{event_section}
28-
29-
除非用户有相关的需求,否则不要主动在对话中提到这些记忆.
3028
---
3129
"""
3230

0 commit comments

Comments
 (0)