This commit is contained in:
SengokuCola
2025-05-27 23:09:50 +08:00
parent 43e465860f
commit 7b05bb3b66
5 changed files with 12 additions and 10 deletions

View File

@@ -292,7 +292,7 @@ class HeartFChatting:
async with global_prompt_manager.async_message_scope(self.chat_stream.context.get_template_name()):
logger.debug(f"模板 {self.chat_stream.context.get_template_name()}")
loop_info = await self._observe_process_plan_action_loop(cycle_timers, thinking_id)
print(loop_info["loop_action_info"]["command"])
if loop_info["loop_action_info"]["command"] == "stop_focus_chat":
logger.info(f"{self.log_prefix} 麦麦决定停止专注聊天")
@@ -441,7 +441,7 @@ class HeartFChatting:
observations.append(self.working_observation)
observations.append(self.hfcloop_observation)
observations.append(self.structure_observation)
loop_observation_info = {
"observations": observations,
}
@@ -562,10 +562,12 @@ class HeartFChatting:
result = await action_handler.handle_action()
if len(result) == 3:
success, reply_text, command = result
else:
else:
success, reply_text = result
command = ""
logger.info(f"{self.log_prefix} 麦麦决定'{action}', 原因'{reasoning}',返回结果'{success}', '{reply_text}', '{command}'")
logger.info(
f"{self.log_prefix} 麦麦决定'{action}', 原因'{reasoning}',返回结果'{success}', '{reply_text}', '{command}'"
)
return success, reply_text, command
except Exception as e:

View File

@@ -136,7 +136,9 @@ class ActionProcessor(BaseProcessor):
reply_sequence.append(action_type == "reply")
# 检查no_reply比例
if len(recent_cycles) >= (5 * global_config.focus_chat.exit_focus_threshold) and (no_reply_count / len(recent_cycles)) >= (0.75 * global_config.focus_chat.exit_focus_threshold):
if len(recent_cycles) >= (5 * global_config.focus_chat.exit_focus_threshold) and (
no_reply_count / len(recent_cycles)
) >= (0.75 * global_config.focus_chat.exit_focus_threshold):
if global_config.chat.chat_mode == "auto":
result["add"].append("exit_focus_chat")
result["remove"].append("no_reply")

View File

@@ -159,8 +159,8 @@ class ActionManager:
"""
# 检查动作是否在当前使用的动作集中
# if action_name not in self._using_actions:
# logger.warning(f"当前不可用的动作类型: {action_name}")
# return None
# logger.warning(f"当前不可用的动作类型: {action_name}")
# return None
handler_class = _ACTION_REGISTRY.get(action_name)
if not handler_class: