feat:新的人格结构,完成20%

This commit is contained in:
SengokuCola
2025-04-06 11:00:59 +08:00
parent 851afc3bbf
commit 594c30ab74
20 changed files with 629 additions and 614 deletions

View File

@@ -15,6 +15,7 @@ from .plugins.config.config import global_config
from .plugins.chat.bot import chat_bot
from .common.logger import get_module_logger
from .plugins.remote import heartbeat_thread # noqa: F401
from .individuality.individuality import Individuality
logger = get_module_logger("main")
@@ -26,6 +27,7 @@ class MainSystem:
self.mood_manager = MoodManager.get_instance()
self.hippocampus_manager = HippocampusManager.get_instance()
self._message_manager_started = False
self.individuality = Individuality.get_instance()
# 使用消息API替代直接的FastAPI实例
from .plugins.message import global_api
@@ -79,7 +81,7 @@ class MainSystem:
# 初始化日程
bot_schedule.initialize(
name=global_config.BOT_NICKNAME,
personality=global_config.PROMPT_PERSONALITY,
personality=global_config.personality_core,
behavior=global_config.PROMPT_SCHEDULE_GEN,
interval=global_config.SCHEDULE_DOING_UPDATE_INTERVAL,
)
@@ -88,6 +90,20 @@ class MainSystem:
# 启动FastAPI服务器
self.app.register_message_handler(chat_bot.message_process)
# 初始化个体特征
self.individuality.initialize(
bot_nickname=global_config.BOT_NICKNAME,
personality_core=global_config.personality_core,
personality_sides=global_config.personality_sides,
identity_detail=global_config.identity_detail,
height=global_config.height,
weight=global_config.weight,
age=global_config.age,
gender=global_config.gender,
appearance=global_config.appearance
)
logger.success("个体特征初始化成功")
try:
# 启动心流系统
asyncio.create_task(heartflow.heartflow_start_working())