feat:增加记忆提取能力

This commit is contained in:
SengokuCola
2025-11-26 16:09:21 +08:00
parent 157b1ed540
commit 0baa73aaf5
7 changed files with 139 additions and 454 deletions

View File

@@ -16,20 +16,17 @@ logger = get_logger("jargon")
def _init_explainer_prompts() -> None:
"""初始化黑话解释器相关的prompt"""
# Prompt概括黑话解释结果
summarize_prompt_str = """
**上下文聊天内容**
summarize_prompt_str = """上下文聊天内容:
{chat_context}
**提取到的黑话及其含义**
在上下文中提取到的黑话及其含义:
{jargon_explanations}
请根据上述信息,对黑话解释进行概括和整理。
- 如果上下文中有黑话出现,请简要说明这些黑话在上下文中的使用情况
- 将黑话解释整理成简洁、易读的格式
- 如果某个黑话在上下文中没有出现,可以省略
- 将所有黑话解释整理成简洁、易读的一段话
- 输出格式要自然,适合作为回复参考信息
请输出概括后的黑话解释直接输出文本不要使用JSON格式
请输出概括后的黑话解释直接输出一段平文本不要标题无特殊格式或markdown格式不要使用JSON格式
"""
Prompt(summarize_prompt_str, "jargon_explainer_summarize_prompt")