feat:可以选择激活值计算模式,默认快速

pull/1217/head
SengokuCola 2025-08-22 17:29:50 +08:00
parent e073ebcbbe
commit 1ddfa47e68
3 changed files with 7 additions and 2 deletions

View File

@ -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:

View File

@ -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 必然回复"""

View File

@ -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 大概率回复