Merge pull request #837 from Dax233/dev

修复PFC在3.12以下版本报错
pull/838/head
墨梓柒 2025-04-24 12:20:51 +08:00 committed by GitHub
commit f09a65e510
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -247,7 +247,8 @@ class ActionPlanner:
prompt = f"""{persona_text}。现在你在参与一场QQ聊天请根据以下【所有信息】审慎决策下一步行动可以发言可以等待可以倾听可以调取知识
当前对话目标
{goals_str if goals_str.strip() else "- 目前没有明确对话目标,请考虑设定一个。\n"}
{goals_str if goals_str.strip() else "- 目前没有明确对话目标,请考虑设定一个。"}
最近行动历史概要
{action_history_summary}
@ -256,7 +257,8 @@ class ActionPlanner:
时间和超时提示
{time_since_last_bot_message_info}{timeout_context}
最近的对话记录(包括你已成功发送的消息 新收到的消息)
{chat_history_text if chat_history_text.strip() else "还没有聊天记录。\n"}
{chat_history_text if chat_history_text.strip() else "还没有聊天记录。"}
--- 行动决策指南 ---
1. **仔细分析上一次行动的详细情况和结果**如果上次行动是 direct_reply 且因内容与你上一条发言完全相同高度相似而被取消(status: recall)那么绝对不要立即再次规划 direct_reply在这种特定情况下你应该优先考虑 wait (等待用户的新回应) rethink_goal (如果对话似乎因此卡住了)
2. 结合当前对话目标最近的对话记录来判断是否需要回应回应什么如果最近的对话记录中有新的用户消息通常需要 direct_reply如果上次行动成功或者上次失败的原因不是重复可以根据对话内容考虑 direct_reply

View File

@ -82,7 +82,7 @@ class ChatBot:
logger.debug(f"用户{userinfo.user_id}被禁止回复")
return
if groupinfo.group_id not in global_config.talk_allowed_groups:
if groupinfo != None and groupinfo.group_id not in global_config.talk_allowed_groups:
logger.debug(f"{groupinfo.group_id}被禁止回复")
return