refactor(proactive_thinker): 优化决策提示词,增加日程与历史记录上下文

为了让主动思考的决策更加贴近当前情境,对决策提示词(Prompt)进行了重构。

- **增强情境感知**:在提示词中增加了日程安排、最近聊天摘要和近期动作历史,为 AI 提供更全面的决策依据。
- **优化结构**:将所有上下文信息整合到“情境分析”部分,使提示词结构更清晰,便于模型理解。
- 修复了获取最近消息时参数传递的错误。
This commit is contained in:
tt-P607
2025-10-03 22:11:49 +08:00
parent bb4ff48e26
commit a8a42694f5

View File

@@ -140,7 +140,7 @@ class ProactiveThinkerExecutor:
else "今天没有日程安排。"
)
recent_messages = await message_api.get_recent_messages(stream_id, limit=10)
recent_messages = await message_api.get_recent_messages(stream.stream_id)
recent_chat_history = (
await message_api.build_readable_messages_to_str(recent_messages) if recent_messages else ""
)
@@ -386,10 +386,18 @@ class ProactiveThinkerExecutor:
# 决策上下文
- **决策理由**: {reason}
- **你和Ta的关系**:
# 情境分析
1. **你的日程**:
{context["schedule_context"]}
2. **你和Ta的关系**:
- 简短印象: {relationship["short_impression"]}
- 详细印象: {relationship["impression"]}
- 好感度: {relationship["attitude"]}/100
3. **最近的聊天摘要**:
{context["recent_chat_history"]}
4. **你最近的相关动作**:
{context["action_history_context"]}
# 对话指引
- 你的目标是“破冰”,让对话自然地开始。