diff --git a/src/plugins/PFC/action_planner.py b/src/plugins/PFC/action_planner.py index df7bac51..754096a7 100644 --- a/src/plugins/PFC/action_planner.py +++ b/src/plugins/PFC/action_planner.py @@ -408,6 +408,10 @@ class ActionPlanner: f"\n--- 以下是 {other_unread_count} 条你需要处理的新消息 ---\n{new_messages_str}\n------\n" ) logger.debug(f"[私聊][{self.private_name}] 向 LLM 追加了 {other_unread_count} 条未读消息。") + else: + chat_history_text += ( + f"\n--- 以上均为已读消息,未读消息均已处理完毕 ---\n" + ) except AttributeError as e: logger.warning(f"[私聊][{self.private_name}] 构建聊天记录文本时属性错误: {e}") chat_history_text = "[获取聊天记录时出错]\n" diff --git a/src/plugins/PFC/pfc.py b/src/plugins/PFC/pfc.py index b17ee21d..69f4d7eb 100644 --- a/src/plugins/PFC/pfc.py +++ b/src/plugins/PFC/pfc.py @@ -98,7 +98,10 @@ class GoalAnalyzer: read_mark=0.0, ) chat_history_text += f"\n--- 以下是 {observation_info.new_messages_count} 条新消息 ---\n{new_messages_str}" - + else: + chat_history_text += ( + f"\n--- 以上均为已读消息,未读消息均已处理完毕 ---\n" + ) # await observation_info.clear_unprocessed_messages() persona_text = f"你的名字是{self.name},{self.personality_info}。" diff --git a/src/plugins/PFC/reply_generator.py b/src/plugins/PFC/reply_generator.py index b93171ea..feba6162 100644 --- a/src/plugins/PFC/reply_generator.py +++ b/src/plugins/PFC/reply_generator.py @@ -175,7 +175,10 @@ class ReplyGenerator: chat_history_text += f"\n--- 以下是 {observation_info.new_messages_count} 条新消息 ---\n{new_messages_str}" elif not chat_history_text: chat_history_text = "还没有聊天记录。" - + else: + chat_history_text += ( + f"\n--- 以上均为已读消息,未读消息均已处理完毕 ---\n" + ) # 构建 Persona 文本 (persona_text) persona_text = f"你的名字是{self.name},{self.personality_info}。" retrieval_context = chat_history_text # 使用前面构建好的 chat_history_text