Merge branch 'dev' of https://github.com/MaiM-with-u/MaiBot into dev
This commit is contained in:
@@ -164,11 +164,9 @@ class ActionModifier:
|
||||
random.shuffle(actions_to_check)
|
||||
|
||||
for action_name, action_info in actions_to_check:
|
||||
activation_type = action_info.activation_type
|
||||
if not activation_type:
|
||||
activation_type = action_info.get("focus_activation_type", "")
|
||||
activation_type = action_info.activation_type or action_info.focus_activation_type
|
||||
|
||||
if activation_type == "always":
|
||||
if activation_type == ActionActivationType.ALWAYS:
|
||||
continue # 总是激活,无需处理
|
||||
|
||||
elif activation_type == ActionActivationType.RANDOM:
|
||||
@@ -505,25 +503,25 @@ class ActionModifier:
|
||||
|
||||
return removals
|
||||
|
||||
def get_available_actions_count(self, mode: str = "focus") -> int:
|
||||
"""获取当前可用动作数量(排除默认的no_action)"""
|
||||
current_actions = self.action_manager.get_using_actions_for_mode(mode)
|
||||
# 排除no_action(如果存在)
|
||||
filtered_actions = {k: v for k, v in current_actions.items() if k != "no_action"}
|
||||
return len(filtered_actions)
|
||||
# def get_available_actions_count(self, mode: str = "focus") -> int:
|
||||
# """获取当前可用动作数量(排除默认的no_action)"""
|
||||
# current_actions = self.action_manager.get_using_actions_for_mode(mode)
|
||||
# # 排除no_action(如果存在)
|
||||
# filtered_actions = {k: v for k, v in current_actions.items() if k != "no_action"}
|
||||
# return len(filtered_actions)
|
||||
|
||||
def should_skip_planning_for_no_reply(self) -> bool:
|
||||
"""判断是否应该跳过规划过程"""
|
||||
current_actions = self.action_manager.get_using_actions_for_mode("focus")
|
||||
# 排除no_action(如果存在)
|
||||
if len(current_actions) == 1 and "no_reply" in current_actions:
|
||||
return True
|
||||
return False
|
||||
# def should_skip_planning_for_no_reply(self) -> bool:
|
||||
# """判断是否应该跳过规划过程"""
|
||||
# current_actions = self.action_manager.get_using_actions_for_mode("focus")
|
||||
# # 排除no_action(如果存在)
|
||||
# if len(current_actions) == 1 and "no_reply" in current_actions:
|
||||
# return True
|
||||
# return False
|
||||
|
||||
def should_skip_planning_for_no_action(self) -> bool:
|
||||
"""判断是否应该跳过规划过程"""
|
||||
available_count = self.action_manager.get_using_actions_for_mode("normal")
|
||||
if available_count == 0:
|
||||
logger.debug(f"{self.log_prefix} 没有可用动作,跳过规划")
|
||||
return True
|
||||
return False
|
||||
# def should_skip_planning_for_no_action(self) -> bool:
|
||||
# """判断是否应该跳过规划过程"""
|
||||
# available_count = self.action_manager.get_using_actions_for_mode("normal")
|
||||
# if available_count == 0:
|
||||
# logger.debug(f"{self.log_prefix} 没有可用动作,跳过规划")
|
||||
# return True
|
||||
# return False
|
||||
|
||||
Reference in New Issue
Block a user