fix(chat): 修复空消息引用并调整动作处理逻辑
- 在 `DefaultReplyer` 中增加了对 `reply_message` 的空值检查,以避免在无回复上下文时引发错误。 - 在 `ActionPlanner` 中将 'do_nothing' 添加到非目标动作列表中,以正确处理此新增的无操作指令。 - 将 `EmojiAction` 使用的 LLM 模型从 'utils_small' 更新为 'planner',以适应模型配置的变更。
This commit is contained in:
@@ -319,7 +319,7 @@ class ActionPlanner:
|
||||
action_data = {k: v for k, v in action_json.items() if k not in ["action", "reason"]}
|
||||
|
||||
target_message = None
|
||||
if action not in ["no_action", "no_reply"]:
|
||||
if action not in ["no_action", "no_reply", "do_nothing"]:
|
||||
if target_message_id := action_json.get("target_message_id"):
|
||||
target_message = self.find_message_by_id(target_message_id, message_id_list)
|
||||
if target_message is None:
|
||||
@@ -329,7 +329,7 @@ class ActionPlanner:
|
||||
logger.warning(f"{self.log_prefix}动作'{action}'缺少target_message_id")
|
||||
|
||||
available_action_names = [name for name, _ in current_available_actions]
|
||||
if action not in ["no_action", "no_reply", "reply"] and action not in available_action_names:
|
||||
if action not in ["no_action", "no_reply", "reply", "do_nothing"] and action not in available_action_names:
|
||||
logger.warning(
|
||||
f"{self.log_prefix}LLM 返回了当前不可用或无效的动作: '{action}' (可用: {available_action_names}),将强制使用 'no_action'"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user