From 1ddfa47e6803b618153be843f851515dd6339c7d Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Fri, 22 Aug 2025 17:29:50 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=8F=AF=E4=BB=A5=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=BF=80=E6=B4=BB=E5=80=BC=E8=AE=A1=E7=AE=97=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=BF=AB=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/heart_flow/heartflow_message_processor.py | 4 ++-- src/config/official_configs.py | 3 +++ template/bot_config_template.toml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/chat/heart_flow/heartflow_message_processor.py b/src/chat/heart_flow/heartflow_message_processor.py index dc953102..ab6f6613 100644 --- a/src/chat/heart_flow/heartflow_message_processor.py +++ b/src/chat/heart_flow/heartflow_message_processor.py @@ -38,7 +38,7 @@ async def _calculate_interest(message: MessageRecv) -> Tuple[float, bool, list[s interested_rate, keywords,keywords_lite = await hippocampus_manager.get_activate_from_text( message.processed_plain_text, max_depth= 4, - fast_retrieval=False, + fast_retrieval=global_config.chat.interest_rate_mode == "fast", ) message.key_words = keywords message.key_words_lite = keywords_lite @@ -85,7 +85,7 @@ async def _calculate_interest(message: MessageRecv) -> Tuple[float, bool, list[s message.interest_value = interested_rate message.is_mentioned = is_mentioned - return interested_rate, is_mentioned, keywords + return interested_rate, keywords class HeartFCMessageReceiver: diff --git a/src/config/official_configs.py b/src/config/official_configs.py index 0087cd62..4acc58fe 100644 --- a/src/config/official_configs.py +++ b/src/config/official_configs.py @@ -70,6 +70,9 @@ class ChatConfig(ConfigBase): max_context_size: int = 18 """上下文长度""" + + interest_rate_mode: Literal["fast", "accurate"] = "fast" + """兴趣值计算模式,fast为快速计算,accurate为精确计算""" mentioned_bot_inevitable_reply: bool = False """提及 bot 必然回复""" diff --git a/template/bot_config_template.toml b/template/bot_config_template.toml index 60cb4dd7..fb711500 100644 --- a/template/bot_config_template.toml +++ b/template/bot_config_template.toml @@ -65,6 +65,8 @@ focus_value = 0.5 max_context_size = 20 # 上下文长度 +interest_rate_mode = "fast" #激活值计算模式,可选fast或者accurate + mentioned_bot_inevitable_reply = true # 提及 bot 大概率回复 at_bot_inevitable_reply = true # @bot 或 提及bot 大概率回复