From ef724b748e5af0d99a996aa1519661872e8105ae Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Thu, 13 Nov 2025 19:45:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(affinity=5Finterest=5Fcalculator):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E5=A4=8D=E5=90=8E=E9=98=88=E5=80=BC?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=BB=E8=BE=91=E5=B9=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=BC=83=E7=94=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/affinity_interest_calculator.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/plugins/built_in/affinity_flow_chatter/core/affinity_interest_calculator.py b/src/plugins/built_in/affinity_flow_chatter/core/affinity_interest_calculator.py index 07d58ef6f..38ae6ad8c 100644 --- a/src/plugins/built_in/affinity_flow_chatter/core/affinity_interest_calculator.py +++ b/src/plugins/built_in/affinity_flow_chatter/core/affinity_interest_calculator.py @@ -307,6 +307,7 @@ class AffinityInterestCalculator(BaseInterestCalculator): self.post_reply_boost_max_count - self.post_reply_boost_remaining ) post_reply_reduction = self.post_reply_threshold_reduction * decay_factor + self.post_reply_boost_remaining -= 1 total_reduction += post_reply_reduction logger.debug( f"[阈值调整] 回复后降低: {post_reply_reduction:.3f} " @@ -319,17 +320,6 @@ class AffinityInterestCalculator(BaseInterestCalculator): return adjusted_reply_threshold, adjusted_action_threshold - def _apply_no_reply_boost(self, base_score: float) -> float: - """【已弃用】应用连续不回复的概率提升 - - 注意:此方法已被 _apply_no_reply_threshold_adjustment 替代 - 保留用于向后兼容 - """ - if self.no_reply_count > 0 and self.no_reply_count < self.max_no_reply_count: - boost = self.no_reply_count * self.probability_boost_per_no_reply - return min(1.0, base_score + boost) - return base_score - def _extract_keywords_from_database(self, message: "DatabaseMessages") -> list[str]: """从数据库消息中提取关键词""" keywords = [] @@ -394,7 +384,7 @@ class AffinityInterestCalculator(BaseInterestCalculator): def on_reply_sent(self): """当机器人发送回复后调用,激活回复后阈值降低机制""" - if self.enable_post_reply_boost: + if self.enable_post_reply_boost and not self.post_reply_boost_remaining: # 重置回复后降低计数器 self.post_reply_boost_remaining = self.post_reply_boost_max_count logger.debug(