Revert "尝试减少不同群内的同义词混淆 以及允许用户设置指定群组记忆私有"
This reverts commit 50c468e519.
This commit is contained in:
@@ -104,12 +104,6 @@ class BotConfig:
|
||||
memory_ban_words: list = field(
|
||||
default_factory=lambda: ["表情包", "图片", "回复", "聊天记录"]
|
||||
) # 添加新的配置项默认值
|
||||
|
||||
# 是否优先使用当前群组的记忆
|
||||
memory_group_priority: bool = True # 默认开启群组记忆优先
|
||||
|
||||
# 群组记忆私有化
|
||||
memory_private_groups: dict = field(default_factory=dict) # 群组私有记忆配置
|
||||
|
||||
@staticmethod
|
||||
def get_config_dir() -> str:
|
||||
@@ -310,12 +304,6 @@ class BotConfig:
|
||||
config.memory_forget_time = memory_config.get("memory_forget_time", config.memory_forget_time)
|
||||
config.memory_forget_percentage = memory_config.get("memory_forget_percentage", config.memory_forget_percentage)
|
||||
config.memory_compress_rate = memory_config.get("memory_compress_rate", config.memory_compress_rate)
|
||||
# 添加对memory_group_priority配置项的加载
|
||||
config.memory_group_priority = memory_config.get("memory_group_priority", config.memory_group_priority)
|
||||
|
||||
if config.INNER_VERSION in SpecifierSet(">=0.0.9"):
|
||||
# 添加群组记忆私有化配置项的加载
|
||||
config.memory_private_groups = memory_config.get("memory_private_groups", {})
|
||||
|
||||
def mood(parent: dict):
|
||||
mood_config = parent["mood"]
|
||||
|
||||
@@ -91,20 +91,12 @@ class PromptBuilder:
|
||||
memory_prompt = ''
|
||||
start_time = time.time()
|
||||
|
||||
# 获取群组ID
|
||||
group_id = None
|
||||
if stream_id:
|
||||
chat_stream = chat_manager.get_stream(stream_id)
|
||||
if chat_stream and chat_stream.group_info:
|
||||
group_id = chat_stream.group_info.group_id
|
||||
|
||||
# 调用 hippocampus 的 get_relevant_memories 方法
|
||||
relevant_memories = await hippocampus.get_relevant_memories(
|
||||
text=message_txt,
|
||||
max_topics=5,
|
||||
similarity_threshold=0.4,
|
||||
max_memory_num=5,
|
||||
group_id=group_id # 传递群组ID
|
||||
max_memory_num=5
|
||||
)
|
||||
|
||||
if relevant_memories:
|
||||
|
||||
Reference in New Issue
Block a user