feat:添加配置项以关闭记忆和关系系统
This commit is contained in:
@@ -51,7 +51,7 @@ PROCESSOR_CLASSES = {
|
|||||||
"ToolProcessor": (ToolProcessor, "tool_use_processor"),
|
"ToolProcessor": (ToolProcessor, "tool_use_processor"),
|
||||||
"WorkingMemoryProcessor": (WorkingMemoryProcessor, "working_memory_processor"),
|
"WorkingMemoryProcessor": (WorkingMemoryProcessor, "working_memory_processor"),
|
||||||
"SelfProcessor": (SelfProcessor, "self_identify_processor"),
|
"SelfProcessor": (SelfProcessor, "self_identify_processor"),
|
||||||
"RelationshipProcessor": (RelationshipProcessor, "relationship_processor"),
|
"RelationshipProcessor": (RelationshipProcessor, "relation_processor"),
|
||||||
}
|
}
|
||||||
|
|
||||||
logger = get_logger("hfc") # Logger Name Changed
|
logger = get_logger("hfc") # Logger Name Changed
|
||||||
@@ -108,10 +108,18 @@ class HeartFChatting:
|
|||||||
|
|
||||||
# 根据配置文件和默认规则确定启用的处理器
|
# 根据配置文件和默认规则确定启用的处理器
|
||||||
config_processor_settings = global_config.focus_chat_processor
|
config_processor_settings = global_config.focus_chat_processor
|
||||||
self.enabled_processor_names = [
|
self.enabled_processor_names = []
|
||||||
proc_name for proc_name, (_proc_class, config_key) in PROCESSOR_CLASSES.items()
|
|
||||||
if not config_key or getattr(config_processor_settings, config_key, True)
|
for proc_name, (_proc_class, config_key) in PROCESSOR_CLASSES.items():
|
||||||
]
|
# 对于关系处理器,需要同时检查两个配置项
|
||||||
|
if proc_name == "RelationshipProcessor":
|
||||||
|
if (global_config.relationship.enable_relationship and
|
||||||
|
getattr(config_processor_settings, config_key, True)):
|
||||||
|
self.enabled_processor_names.append(proc_name)
|
||||||
|
else:
|
||||||
|
# 其他处理器的原有逻辑
|
||||||
|
if not config_key or getattr(config_processor_settings, config_key, True):
|
||||||
|
self.enabled_processor_names.append(proc_name)
|
||||||
|
|
||||||
# logger.info(f"{self.log_prefix} 将启用的处理器: {self.enabled_processor_names}")
|
# logger.info(f"{self.log_prefix} 将启用的处理器: {self.enabled_processor_names}")
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from src.chat.memory_system.Hippocampus import HippocampusManager
|
from src.chat.memory_system.Hippocampus import hippocampus_manager
|
||||||
from src.config.config import global_config
|
from src.config.config import global_config
|
||||||
from src.chat.message_receive.message import MessageRecv
|
from src.chat.message_receive.message import MessageRecv
|
||||||
from src.chat.message_receive.storage import MessageStorage
|
from src.chat.message_receive.storage import MessageStorage
|
||||||
@@ -67,11 +67,14 @@ async def _calculate_interest(message: MessageRecv) -> Tuple[float, bool]:
|
|||||||
is_mentioned, _ = is_mentioned_bot_in_message(message)
|
is_mentioned, _ = is_mentioned_bot_in_message(message)
|
||||||
interested_rate = 0.0
|
interested_rate = 0.0
|
||||||
|
|
||||||
|
if global_config.memory.enable_memory:
|
||||||
with Timer("记忆激活"):
|
with Timer("记忆激活"):
|
||||||
interested_rate = await HippocampusManager.get_instance().get_activate_from_text(
|
interested_rate = await hippocampus_manager.get_activate_from_text(
|
||||||
message.processed_plain_text,
|
message.processed_plain_text,
|
||||||
fast_retrieval=True,
|
fast_retrieval=True,
|
||||||
)
|
)
|
||||||
|
logger.trace(f"记忆激活率: {interested_rate:.2f}")
|
||||||
|
|
||||||
text_len = len(message.processed_plain_text)
|
text_len = len(message.processed_plain_text)
|
||||||
# 根据文本长度调整兴趣度,长度越大兴趣度越高,但增长率递减,最低0.01,最高0.05
|
# 根据文本长度调整兴趣度,长度越大兴趣度越高,但增长率递减,最低0.01,最高0.05
|
||||||
# 采用对数函数实现递减增长
|
# 采用对数函数实现递减增长
|
||||||
@@ -81,8 +84,6 @@ async def _calculate_interest(message: MessageRecv) -> Tuple[float, bool]:
|
|||||||
|
|
||||||
interested_rate += base_interest
|
interested_rate += base_interest
|
||||||
|
|
||||||
logger.trace(f"记忆激活率: {interested_rate:.2f}")
|
|
||||||
|
|
||||||
if is_mentioned:
|
if is_mentioned:
|
||||||
interest_increase_on_mention = 1
|
interest_increase_on_mention = 1
|
||||||
interested_rate += interest_increase_on_mention
|
interested_rate += interest_increase_on_mention
|
||||||
@@ -210,7 +211,7 @@ class HeartFCMessageReceiver:
|
|||||||
logger.info(f"[{mes_name}]{userinfo.user_nickname}:{message.processed_plain_text}")
|
logger.info(f"[{mes_name}]{userinfo.user_nickname}:{message.processed_plain_text}")
|
||||||
|
|
||||||
# 8. 关系处理
|
# 8. 关系处理
|
||||||
if global_config.relationship.give_name:
|
if global_config.relationship.enable_relationship and global_config.relationship.give_name:
|
||||||
await _process_relationship(message)
|
await _process_relationship(message)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ class MindProcessor(BaseProcessor):
|
|||||||
# 获取个性化信息
|
# 获取个性化信息
|
||||||
|
|
||||||
relation_prompt = ""
|
relation_prompt = ""
|
||||||
|
if global_config.relationship.enable_relationship:
|
||||||
for person in person_list:
|
for person in person_list:
|
||||||
relation_prompt += await relationship_manager.build_relationship_info(person, is_id=True)
|
relation_prompt += await relationship_manager.build_relationship_info(person, is_id=True)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from src.config.config import global_config
|
|||||||
from src.common.logger_manager import get_logger
|
from src.common.logger_manager import get_logger
|
||||||
from src.chat.utils.prompt_builder import Prompt, global_prompt_manager
|
from src.chat.utils.prompt_builder import Prompt, global_prompt_manager
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from src.chat.memory_system.Hippocampus import HippocampusManager
|
from src.chat.memory_system.Hippocampus import hippocampus_manager
|
||||||
from typing import List, Dict
|
from typing import List, Dict
|
||||||
import difflib
|
import difflib
|
||||||
import json
|
import json
|
||||||
@@ -87,6 +87,10 @@ class MemoryActivator:
|
|||||||
Returns:
|
Returns:
|
||||||
List[Dict]: 激活的记忆列表
|
List[Dict]: 激活的记忆列表
|
||||||
"""
|
"""
|
||||||
|
# 如果记忆系统被禁用,直接返回空列表
|
||||||
|
if not global_config.memory.enable_memory:
|
||||||
|
return []
|
||||||
|
|
||||||
obs_info_text = ""
|
obs_info_text = ""
|
||||||
for observation in observations:
|
for observation in observations:
|
||||||
if isinstance(observation, ChattingObservation):
|
if isinstance(observation, ChattingObservation):
|
||||||
@@ -128,10 +132,10 @@ class MemoryActivator:
|
|||||||
logger.debug(f"当前激活的记忆关键词: {self.cached_keywords}")
|
logger.debug(f"当前激活的记忆关键词: {self.cached_keywords}")
|
||||||
|
|
||||||
# 调用记忆系统获取相关记忆
|
# 调用记忆系统获取相关记忆
|
||||||
related_memory = await HippocampusManager.get_instance().get_memory_from_topic(
|
related_memory = await hippocampus_manager.get_memory_from_topic(
|
||||||
valid_keywords=keywords, max_memory_num=3, max_memory_length=2, max_depth=3
|
valid_keywords=keywords, max_memory_num=3, max_memory_length=2, max_depth=3
|
||||||
)
|
)
|
||||||
# related_memory = await HippocampusManager.get_instance().get_memory_from_text(
|
# related_memory = await hippocampus_manager.get_memory_from_text(
|
||||||
# text=obs_info_text, max_memory_num=5, max_memory_length=2, max_depth=3, fast_retrieval=False
|
# text=obs_info_text, max_memory_num=5, max_memory_length=2, max_depth=3, fast_retrieval=False
|
||||||
# )
|
# )
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class ActionPlanner(BasePlanner):
|
|||||||
prompt = f"{prompt}"
|
prompt = f"{prompt}"
|
||||||
llm_content, (reasoning_content, _) = await self.planner_llm.generate_response_async(prompt=prompt)
|
llm_content, (reasoning_content, _) = await self.planner_llm.generate_response_async(prompt=prompt)
|
||||||
|
|
||||||
# logger.info(f"{self.log_prefix}规划器原始提示词: {prompt}")
|
logger.info(f"{self.log_prefix}规划器原始提示词: {prompt}")
|
||||||
logger.info(f"{self.log_prefix}规划器原始响应: {llm_content}")
|
logger.info(f"{self.log_prefix}规划器原始响应: {llm_content}")
|
||||||
logger.info(f"{self.log_prefix}规划器推理: {reasoning_content}")
|
logger.info(f"{self.log_prefix}规划器推理: {reasoning_content}")
|
||||||
|
|
||||||
|
|||||||
@@ -1655,21 +1655,9 @@ class ParahippocampalGyrus:
|
|||||||
|
|
||||||
|
|
||||||
class HippocampusManager:
|
class HippocampusManager:
|
||||||
_instance = None
|
def __init__(self):
|
||||||
_hippocampus = None
|
self._hippocampus = None
|
||||||
_initialized = False
|
self._initialized = False
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_instance(cls):
|
|
||||||
if cls._instance is None:
|
|
||||||
cls._instance = cls()
|
|
||||||
return cls._instance
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_hippocampus(cls):
|
|
||||||
if not cls._initialized:
|
|
||||||
raise RuntimeError("HippocampusManager 尚未初始化,请先调用 initialize 方法")
|
|
||||||
return cls._hippocampus
|
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
"""初始化海马体实例"""
|
"""初始化海马体实例"""
|
||||||
@@ -1695,6 +1683,11 @@ class HippocampusManager:
|
|||||||
|
|
||||||
return self._hippocampus
|
return self._hippocampus
|
||||||
|
|
||||||
|
def get_hippocampus(self):
|
||||||
|
if not self._initialized:
|
||||||
|
raise RuntimeError("HippocampusManager 尚未初始化,请先调用 initialize 方法")
|
||||||
|
return self._hippocampus
|
||||||
|
|
||||||
async def build_memory(self):
|
async def build_memory(self):
|
||||||
"""构建记忆的公共接口"""
|
"""构建记忆的公共接口"""
|
||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
@@ -1772,3 +1765,7 @@ class HippocampusManager:
|
|||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
raise RuntimeError("HippocampusManager 尚未初始化,请先调用 initialize 方法")
|
raise RuntimeError("HippocampusManager 尚未初始化,请先调用 initialize 方法")
|
||||||
return self._hippocampus.get_all_node_names()
|
return self._hippocampus.get_all_node_names()
|
||||||
|
|
||||||
|
|
||||||
|
# 创建全局实例
|
||||||
|
hippocampus_manager = HippocampusManager()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from src.person_info.relationship_manager import relationship_manager
|
|||||||
import time
|
import time
|
||||||
from src.chat.utils.utils import get_recent_group_speaker
|
from src.chat.utils.utils import get_recent_group_speaker
|
||||||
from src.manager.mood_manager import mood_manager
|
from src.manager.mood_manager import mood_manager
|
||||||
from src.chat.memory_system.Hippocampus import HippocampusManager
|
from src.chat.memory_system.Hippocampus import hippocampus_manager
|
||||||
from src.chat.knowledge.knowledge_lib import qa_manager
|
from src.chat.knowledge.knowledge_lib import qa_manager
|
||||||
from src.chat.focus_chat.expressors.exprssion_learner import expression_learner
|
from src.chat.focus_chat.expressors.exprssion_learner import expression_learner
|
||||||
import random
|
import random
|
||||||
@@ -112,6 +112,7 @@ class PromptBuilder:
|
|||||||
)
|
)
|
||||||
|
|
||||||
relation_prompt = ""
|
relation_prompt = ""
|
||||||
|
if global_config.relationship.enable_relationship:
|
||||||
for person in who_chat_in_group:
|
for person in who_chat_in_group:
|
||||||
relation_prompt += await relationship_manager.build_relationship_info(person)
|
relation_prompt += await relationship_manager.build_relationship_info(person)
|
||||||
|
|
||||||
@@ -159,7 +160,8 @@ class PromptBuilder:
|
|||||||
)[0]
|
)[0]
|
||||||
memory_prompt = ""
|
memory_prompt = ""
|
||||||
|
|
||||||
related_memory = await HippocampusManager.get_instance().get_memory_from_text(
|
if global_config.memory.enable_memory:
|
||||||
|
related_memory = await hippocampus_manager.get_memory_from_text(
|
||||||
text=message_txt, max_memory_num=2, max_memory_length=2, max_depth=3, fast_retrieval=False
|
text=message_txt, max_memory_num=2, max_memory_length=2, max_depth=3, fast_retrieval=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ class IdentityConfig(ConfigBase):
|
|||||||
class RelationshipConfig(ConfigBase):
|
class RelationshipConfig(ConfigBase):
|
||||||
"""关系配置类"""
|
"""关系配置类"""
|
||||||
|
|
||||||
|
enable_relationship: bool = True
|
||||||
|
|
||||||
give_name: bool = False
|
give_name: bool = False
|
||||||
"""是否给其他人取名"""
|
"""是否给其他人取名"""
|
||||||
|
|
||||||
@@ -221,6 +223,8 @@ class EmojiConfig(ConfigBase):
|
|||||||
class MemoryConfig(ConfigBase):
|
class MemoryConfig(ConfigBase):
|
||||||
"""记忆配置类"""
|
"""记忆配置类"""
|
||||||
|
|
||||||
|
enable_memory: bool = True
|
||||||
|
|
||||||
memory_build_interval: int = 600
|
memory_build_interval: int = 600
|
||||||
"""记忆构建间隔(秒)"""
|
"""记忆构建间隔(秒)"""
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
from src.common.logger import get_module_logger
|
from src.common.logger import get_module_logger
|
||||||
from src.chat.memory_system.Hippocampus import HippocampusManager
|
from src.chat.memory_system.Hippocampus import hippocampus_manager
|
||||||
from src.llm_models.utils_model import LLMRequest
|
from src.llm_models.utils_model import LLMRequest
|
||||||
from src.config.config import global_config
|
from src.config.config import global_config
|
||||||
from src.chat.message_receive.message import Message
|
from src.chat.message_receive.message import Message
|
||||||
@@ -62,7 +62,7 @@ class KnowledgeFetcher:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 从记忆中获取相关知识
|
# 从记忆中获取相关知识
|
||||||
related_memory = await HippocampusManager.get_instance().get_memory_from_text(
|
related_memory = await hippocampus_manager.get_memory_from_text(
|
||||||
text=f"{query}\n{chat_history_text}",
|
text=f"{query}\n{chat_history_text}",
|
||||||
max_memory_num=3,
|
max_memory_num=3,
|
||||||
max_memory_length=2,
|
max_memory_length=2,
|
||||||
|
|||||||
52
src/main.py
52
src/main.py
@@ -9,7 +9,6 @@ from .chat.emoji_system.emoji_manager import emoji_manager
|
|||||||
from .chat.normal_chat.willing.willing_manager import willing_manager
|
from .chat.normal_chat.willing.willing_manager import willing_manager
|
||||||
from .chat.message_receive.chat_stream import chat_manager
|
from .chat.message_receive.chat_stream import chat_manager
|
||||||
from src.chat.heart_flow.heartflow import heartflow
|
from src.chat.heart_flow.heartflow import heartflow
|
||||||
from .chat.memory_system.Hippocampus import HippocampusManager
|
|
||||||
from .chat.message_receive.message_sender import message_manager
|
from .chat.message_receive.message_sender import message_manager
|
||||||
from .chat.message_receive.storage import MessageStorage
|
from .chat.message_receive.storage import MessageStorage
|
||||||
from .config.config import global_config
|
from .config.config import global_config
|
||||||
@@ -23,6 +22,10 @@ from .api.main import start_api_server
|
|||||||
# 导入actions模块,确保装饰器被执行
|
# 导入actions模块,确保装饰器被执行
|
||||||
import src.chat.actions.default_actions # noqa
|
import src.chat.actions.default_actions # noqa
|
||||||
|
|
||||||
|
# 条件导入记忆系统
|
||||||
|
if global_config.memory.enable_memory:
|
||||||
|
from .chat.memory_system.Hippocampus import hippocampus_manager
|
||||||
|
|
||||||
# 加载插件actions
|
# 加载插件actions
|
||||||
import importlib
|
import importlib
|
||||||
import pkgutil
|
import pkgutil
|
||||||
@@ -35,7 +38,12 @@ logger = get_logger("main")
|
|||||||
|
|
||||||
class MainSystem:
|
class MainSystem:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.hippocampus_manager: HippocampusManager = HippocampusManager.get_instance()
|
# 根据配置条件性地初始化记忆系统
|
||||||
|
if global_config.memory.enable_memory:
|
||||||
|
self.hippocampus_manager = hippocampus_manager
|
||||||
|
else:
|
||||||
|
self.hippocampus_manager = None
|
||||||
|
|
||||||
self.individuality: Individuality = individuality
|
self.individuality: Individuality = individuality
|
||||||
|
|
||||||
# 使用消息API替代直接的FastAPI实例
|
# 使用消息API替代直接的FastAPI实例
|
||||||
@@ -90,8 +98,14 @@ class MainSystem:
|
|||||||
await chat_manager._initialize()
|
await chat_manager._initialize()
|
||||||
asyncio.create_task(chat_manager._auto_save_task())
|
asyncio.create_task(chat_manager._auto_save_task())
|
||||||
|
|
||||||
# 使用HippocampusManager初始化海马体
|
# 根据配置条件性地初始化记忆系统
|
||||||
|
if global_config.memory.enable_memory:
|
||||||
|
if self.hippocampus_manager:
|
||||||
self.hippocampus_manager.initialize()
|
self.hippocampus_manager.initialize()
|
||||||
|
logger.success("记忆系统初始化成功")
|
||||||
|
else:
|
||||||
|
logger.info("记忆系统已禁用,跳过初始化")
|
||||||
|
|
||||||
# await asyncio.sleep(0.5) #防止logger输出飞了
|
# await asyncio.sleep(0.5) #防止logger输出飞了
|
||||||
|
|
||||||
# 将bot.py中的chat_bot.message_process消息处理函数注册到api.py的消息处理基类中
|
# 将bot.py中的chat_bot.message_process消息处理函数注册到api.py的消息处理基类中
|
||||||
@@ -201,43 +215,47 @@ class MainSystem:
|
|||||||
"""调度定时任务"""
|
"""调度定时任务"""
|
||||||
while True:
|
while True:
|
||||||
tasks = [
|
tasks = [
|
||||||
self.build_memory_task(),
|
|
||||||
self.forget_memory_task(),
|
|
||||||
self.consolidate_memory_task(),
|
|
||||||
self.learn_and_store_expression_task(),
|
|
||||||
self.remove_recalled_message_task(),
|
|
||||||
emoji_manager.start_periodic_check_register(),
|
emoji_manager.start_periodic_check_register(),
|
||||||
|
self.remove_recalled_message_task(),
|
||||||
self.app.run(),
|
self.app.run(),
|
||||||
self.server.run(),
|
self.server.run(),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# 根据配置条件性地添加记忆系统相关任务
|
||||||
|
if global_config.memory.enable_memory and self.hippocampus_manager:
|
||||||
|
tasks.extend([
|
||||||
|
self.build_memory_task(),
|
||||||
|
self.forget_memory_task(),
|
||||||
|
self.consolidate_memory_task(),
|
||||||
|
])
|
||||||
|
|
||||||
|
tasks.append(self.learn_and_store_expression_task())
|
||||||
|
|
||||||
await asyncio.gather(*tasks)
|
await asyncio.gather(*tasks)
|
||||||
|
|
||||||
@staticmethod
|
async def build_memory_task(self):
|
||||||
async def build_memory_task():
|
|
||||||
"""记忆构建任务"""
|
"""记忆构建任务"""
|
||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(global_config.memory.memory_build_interval)
|
await asyncio.sleep(global_config.memory.memory_build_interval)
|
||||||
logger.info("正在进行记忆构建")
|
logger.info("正在进行记忆构建")
|
||||||
await HippocampusManager.get_instance().build_memory()
|
await self.hippocampus_manager.build_memory()
|
||||||
|
|
||||||
@staticmethod
|
async def forget_memory_task(self):
|
||||||
async def forget_memory_task():
|
|
||||||
"""记忆遗忘任务"""
|
"""记忆遗忘任务"""
|
||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(global_config.memory.forget_memory_interval)
|
await asyncio.sleep(global_config.memory.forget_memory_interval)
|
||||||
logger.info("[记忆遗忘] 开始遗忘记忆...")
|
logger.info("[记忆遗忘] 开始遗忘记忆...")
|
||||||
await HippocampusManager.get_instance().forget_memory(
|
await self.hippocampus_manager.forget_memory(
|
||||||
percentage=global_config.memory.memory_forget_percentage
|
percentage=global_config.memory.memory_forget_percentage
|
||||||
)
|
)
|
||||||
logger.info("[记忆遗忘] 记忆遗忘完成")
|
logger.info("[记忆遗忘] 记忆遗忘完成")
|
||||||
|
|
||||||
@staticmethod
|
async def consolidate_memory_task(self):
|
||||||
async def consolidate_memory_task():
|
|
||||||
"""记忆整合任务"""
|
"""记忆整合任务"""
|
||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(global_config.memory.consolidate_memory_interval)
|
await asyncio.sleep(global_config.memory.consolidate_memory_interval)
|
||||||
logger.info("[记忆整合] 开始整合记忆...")
|
logger.info("[记忆整合] 开始整合记忆...")
|
||||||
await HippocampusManager.get_instance().consolidate_memory()
|
await self.hippocampus_manager.consolidate_memory()
|
||||||
logger.info("[记忆整合] 记忆整合完成")
|
logger.info("[记忆整合] 记忆整合完成")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[inner]
|
[inner]
|
||||||
version = "2.16.0"
|
version = "2.17.0"
|
||||||
|
|
||||||
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
|
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
|
||||||
#如果你想要修改配置文件,请在修改后将version的值进行变更
|
#如果你想要修改配置文件,请在修改后将version的值进行变更
|
||||||
@@ -45,7 +45,7 @@ enable_expression_learning = false # 是否启用表达学习,麦麦会学习
|
|||||||
learning_interval = 600 # 学习间隔 单位秒
|
learning_interval = 600 # 学习间隔 单位秒
|
||||||
|
|
||||||
[relationship]
|
[relationship]
|
||||||
give_name = true # 麦麦是否给其他人取名
|
enable_relationship = true # 是否启用关系系统
|
||||||
|
|
||||||
[chat] #麦麦的聊天通用设置
|
[chat] #麦麦的聊天通用设置
|
||||||
chat_mode = "normal" # 聊天模式 —— 普通模式:normal,专注模式:focus,在普通模式和专注模式之间自动切换
|
chat_mode = "normal" # 聊天模式 —— 普通模式:normal,专注模式:focus,在普通模式和专注模式之间自动切换
|
||||||
@@ -114,6 +114,7 @@ content_filtration = false # 是否启用表情包过滤,只有符合该要
|
|||||||
filtration_prompt = "符合公序良俗" # 表情包过滤要求,只有符合该要求的表情包才会被保存
|
filtration_prompt = "符合公序良俗" # 表情包过滤要求,只有符合该要求的表情包才会被保存
|
||||||
|
|
||||||
[memory]
|
[memory]
|
||||||
|
enable_memory = true # 是否启用记忆系统
|
||||||
memory_build_interval = 1000 # 记忆构建间隔 单位秒 间隔越低,麦麦学习越多,但是冗余信息也会增多
|
memory_build_interval = 1000 # 记忆构建间隔 单位秒 间隔越低,麦麦学习越多,但是冗余信息也会增多
|
||||||
memory_build_distribution = [6.0, 3.0, 0.6, 32.0, 12.0, 0.4] # 记忆构建分布,参数:分布1均值,标准差,权重,分布2均值,标准差,权重
|
memory_build_distribution = [6.0, 3.0, 0.6, 32.0, 12.0, 0.4] # 记忆构建分布,参数:分布1均值,标准差,权重,分布2均值,标准差,权重
|
||||||
memory_build_sample_num = 4 # 采样数量,数值越高记忆采样次数越多
|
memory_build_sample_num = 4 # 采样数量,数值越高记忆采样次数越多
|
||||||
|
|||||||
Reference in New Issue
Block a user