From fe43cb3816dfaef71dbef4bc43c8fe73226b2ef8 Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Thu, 14 Aug 2025 15:33:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E8=81=8A=E5=A4=A9=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=99=A8=E4=B8=AD=E7=9A=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E4=BB=8Einfo=E8=B0=83=E6=95=B4=E4=B8=BAdebug?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=87=8F=E5=B0=91=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E5=86=97=E4=BD=99=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF=E7=9A=84=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/utils/chat_message_builder.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/chat/utils/chat_message_builder.py b/src/chat/utils/chat_message_builder.py index be619bb45..2e2de42ee 100644 --- a/src/chat/utils/chat_message_builder.py +++ b/src/chat/utils/chat_message_builder.py @@ -812,7 +812,7 @@ def build_readable_actions(actions: List[Dict[str, Any]]) -> str: from src.common.logger import get_logger logger = get_logger("chat_message_builder") - logger.info(f"[build_readable_actions] 开始处理 {len(actions) if actions else 0} 条动作记录") + logger.debug(f"[build_readable_actions] 开始处理 {len(actions) if actions else 0} 条动作记录") if not actions: logger.debug("[build_readable_actions] 动作记录为空,返回空字符串") @@ -821,19 +821,19 @@ def build_readable_actions(actions: List[Dict[str, Any]]) -> str: output_lines = [] current_time = time.time() - logger.info(f"[build_readable_actions] 当前时间戳: {current_time}") + logger.debug(f"[build_readable_actions] 当前时间戳: {current_time}") # The get functions return actions sorted ascending by time. Let's reverse it to show newest first. # sorted_actions = sorted(actions, key=lambda x: x.get("time", 0), reverse=True) for i, action in enumerate(actions): - logger.info(f"[build_readable_actions] === 处理第 {i} 条动作记录 ===") - logger.info(f"[build_readable_actions] 原始动作数据: {action}") + logger.debug(f"[build_readable_actions] === 处理第 {i} 条动作记录 ===") + logger.debug(f"[build_readable_actions] 原始动作数据: {action}") action_time = action.get("time", current_time) action_name = action.get("action_name", "未知动作") - logger.info(f"[build_readable_actions] 动作时间戳: {action_time}, 动作名称: '{action_name}'") + logger.debug(f"[build_readable_actions] 动作时间戳: {action_time}, 动作名称: '{action_name}'") # 检查是否是原始的 action_name 值 original_action_name = action.get("action_name") @@ -849,10 +849,10 @@ def build_readable_actions(actions: List[Dict[str, Any]]) -> str: continue action_prompt_display = action.get("action_prompt_display", "无具体内容") - logger.info(f"[build_readable_actions] 动作提示显示: '{action_prompt_display}'") + logger.debug(f"[build_readable_actions] 动作提示显示: '{action_prompt_display}'") time_diff_seconds = current_time - action_time - logger.info(f"[build_readable_actions] 时间差: {time_diff_seconds} 秒") + logger.debug(f"[build_readable_actions] 时间差: {time_diff_seconds} 秒") if time_diff_seconds < 60: time_ago_str = f"在{int(time_diff_seconds)}秒前" @@ -860,14 +860,14 @@ def build_readable_actions(actions: List[Dict[str, Any]]) -> str: time_diff_minutes = round(time_diff_seconds / 60) time_ago_str = f"在{int(time_diff_minutes)}分钟前" - logger.info(f"[build_readable_actions] 时间描述: '{time_ago_str}'") + logger.debug(f"[build_readable_actions] 时间描述: '{time_ago_str}'") line = f"{time_ago_str},你使用了\"{action_name}\",具体内容是:\"{action_prompt_display}\"" - logger.info(f"[build_readable_actions] 生成的行: '{line}'") + logger.debug(f"[build_readable_actions] 生成的行: '{line}'") output_lines.append(line) result = "\n".join(output_lines) - logger.info(f"[build_readable_actions] 最终结果: '{result}'") + logger.debug(f"[build_readable_actions] 最终结果: '{result}'") return result