From b905320c0724e6b801b928adbe2d413552210d34 Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Fri, 19 Sep 2025 17:51:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(affinity-flow):=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=98=88=E5=80=BC=E6=9B=BF=E6=8D=A2=E7=A1=AC?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E7=9A=8480%=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将硬编码的80%阈值检查替换为从全局配置读取的`non_reply_action_interest_threshold`参数,提高配置灵活性并统一阈值管理。 - 移除硬编码的阈值计算逻辑 - 使用全局配置中的非回复动作兴趣度阈值 - 更新日志信息和返回理由中的阈值描述 --- src/chat/planner_actions/planner.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chat/planner_actions/planner.py b/src/chat/planner_actions/planner.py index 5d26b626b..0da687f2f 100644 --- a/src/chat/planner_actions/planner.py +++ b/src/chat/planner_actions/planner.py @@ -137,16 +137,16 @@ class ActionPlanner: base_threshold = self.interest_scoring.reply_threshold # 检查兴趣度是否达到阈值的0.8 - threshold_requirement = base_threshold * 0.8 - if score < threshold_requirement: - logger.info(f"❌ 兴趣度不足阈值的80%: {score:.3f} < {threshold_requirement:.3f},直接返回no_action") - logger.info(f"📊 最低要求: 阈值({base_threshold:.3f}) × 0.8 = {threshold_requirement:.3f}") + non_reply_action_interest_threshold = global_config.affinity_flow.non_reply_action_interest_threshold + if score < non_reply_action_interest_threshold: + logger.info(f"❌ 兴趣度不足非回复动作阈值: {score:.3f} < {non_reply_action_interest_threshold:.3f},直接返回no_action") + logger.info(f"📊 最低要求: {non_reply_action_interest_threshold:.3f}") # 直接返回 no_action from src.common.data_models.info_data_model import ActionPlannerInfo no_action = ActionPlannerInfo( action_type="no_action", - reasoning=f"兴趣度评分 {score:.3f} 未达阈值80% {threshold_requirement:.3f}", + reasoning=f"兴趣度评分 {score:.3f} 未达阈值 {non_reply_action_interest_threshold:.3f}", action_data={}, action_message=None, )