diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index a6933a767..4087a498a 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -64,8 +64,7 @@ DEFAULT_CONFIG = { "method": "possibility_reply", "possibility_reply": 0.1, "prompt": "", - }, - "put_history_to_prompt": True, + } }, "content_safety": { "internal_keywords": {"enable": True, "extra_keywords": []}, @@ -763,12 +762,6 @@ CONFIG_METADATA_2 = { "hint": "提示词。当提示词为空时,如果触发回复,则向 LLM 请求的是触发的消息的内容;否则是提示词。此项可以和定时回复(暂未实现)配合使用。", }, }, - }, - "put_history_to_prompt": { - "description": "将群聊历史记录作为 prompt", - "type": "bool", - "obvious_hint": True, - "hint": "需要先启用 group_icl_enable。此功能会将群聊历史记录放到 prompt 再请求。如果关闭,则是放在 system_prompt。如果开启了主动回复,建议启用,模型能够更好地完成回复任务。", } }, }, diff --git a/packages/astrbot/long_term_memory.py b/packages/astrbot/long_term_memory.py index a55df03ef..f1ec8b252 100644 --- a/packages/astrbot/long_term_memory.py +++ b/packages/astrbot/long_term_memory.py @@ -33,7 +33,7 @@ class LongTermMemory: self.ar_possibility = self.active_reply["possibility_reply"] self.ar_prompt = self.active_reply.get("prompt", "") - self.put_history_to_prompt = self.config["put_history_to_prompt"] + # self.put_history_to_prompt = self.config["put_history_to_prompt"] async def remove_session(self, event: AstrMessageEvent) -> int: cnt = 0 @@ -110,11 +110,11 @@ class LongTermMemory: chats_str = '\n---\n'.join(self.session_chats[event.unified_msg_origin]) - if self.put_history_to_prompt: + if self.enable_active_reply: prompt = req.prompt req.prompt = f"You are now in a chatroom. The chat history is as follows:\n{chats_str}" req.prompt += f"\nNow, a new message is coming: `{prompt}`. Please react to it. Only output your response and do not output any other information." - req.contexts = [] # 清空上下文,当使用了群聊增强,所有聊天记录都在一个prompt中。 + req.contexts = [] # 清空上下文,当使用了主动回复,所有聊天记录都在一个prompt中。 else: req.system_prompt += "You are now in a chatroom. The chat history is as follows: \n" req.system_prompt += chats_str