feat:可以选择激活值计算模式,默认快速
This commit is contained in:
@@ -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(
|
interested_rate, keywords,keywords_lite = await hippocampus_manager.get_activate_from_text(
|
||||||
message.processed_plain_text,
|
message.processed_plain_text,
|
||||||
max_depth= 4,
|
max_depth= 4,
|
||||||
fast_retrieval=False,
|
fast_retrieval=global_config.chat.interest_rate_mode == "fast",
|
||||||
)
|
)
|
||||||
message.key_words = keywords
|
message.key_words = keywords
|
||||||
message.key_words_lite = keywords_lite
|
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.interest_value = interested_rate
|
||||||
message.is_mentioned = is_mentioned
|
message.is_mentioned = is_mentioned
|
||||||
|
|
||||||
return interested_rate, is_mentioned, keywords
|
return interested_rate, keywords
|
||||||
|
|
||||||
|
|
||||||
class HeartFCMessageReceiver:
|
class HeartFCMessageReceiver:
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ class ChatConfig(ConfigBase):
|
|||||||
max_context_size: int = 18
|
max_context_size: int = 18
|
||||||
"""上下文长度"""
|
"""上下文长度"""
|
||||||
|
|
||||||
|
interest_rate_mode: Literal["fast", "accurate"] = "fast"
|
||||||
|
"""兴趣值计算模式,fast为快速计算,accurate为精确计算"""
|
||||||
|
|
||||||
mentioned_bot_inevitable_reply: bool = False
|
mentioned_bot_inevitable_reply: bool = False
|
||||||
"""提及 bot 必然回复"""
|
"""提及 bot 必然回复"""
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ focus_value = 0.5
|
|||||||
|
|
||||||
max_context_size = 20 # 上下文长度
|
max_context_size = 20 # 上下文长度
|
||||||
|
|
||||||
|
interest_rate_mode = "fast" #激活值计算模式,可选fast或者accurate
|
||||||
|
|
||||||
mentioned_bot_inevitable_reply = true # 提及 bot 大概率回复
|
mentioned_bot_inevitable_reply = true # 提及 bot 大概率回复
|
||||||
at_bot_inevitable_reply = true # @bot 或 提及bot 大概率回复
|
at_bot_inevitable_reply = true # @bot 或 提及bot 大概率回复
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user