From 702112fdc47becdd924aee1e6568f45493744d60 Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Sat, 23 Aug 2025 21:31:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E5=A2=9E=E5=8A=A0=E5=8F=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E5=94=A4=E9=86=92=E6=84=A4=E6=80=92?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将唤醒后愤怒状态下的固定提示词修改为可在配置文件中自定义的选项,提高了灵活性。 默认值保持原有的提示词内容。 --- src/chat/chat_loop/wakeup_manager.py | 3 ++- src/config/official_configs.py | 1 + template/bot_config_template.toml | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/chat/chat_loop/wakeup_manager.py b/src/chat/chat_loop/wakeup_manager.py index f3a9ee919..fa755e882 100644 --- a/src/chat/chat_loop/wakeup_manager.py +++ b/src/chat/chat_loop/wakeup_manager.py @@ -36,6 +36,7 @@ class WakeUpManager: self.decay_interval = wakeup_config.decay_interval self.angry_duration = wakeup_config.angry_duration self.enabled = wakeup_config.enable + self.angry_prompt = wakeup_config.angry_prompt async def start(self): """启动唤醒度管理器""" @@ -146,7 +147,7 @@ class WakeUpManager: def get_angry_prompt_addition(self) -> str: """获取愤怒状态下的提示词补充""" if self.is_angry: - return "你被人吵醒了非常生气,说话带着怒气" + return self.angry_prompt return "" def is_in_angry_state(self) -> bool: diff --git a/src/config/official_configs.py b/src/config/official_configs.py index 847f8a015..a447a9d95 100644 --- a/src/config/official_configs.py +++ b/src/config/official_configs.py @@ -674,6 +674,7 @@ class WakeUpSystemConfig(ValidatedConfigBase): decay_rate: float = Field(default=0.2, ge=0.0, description="每次衰减的唤醒度数值") decay_interval: float = Field(default=30.0, ge=1.0, description="唤醒度衰减间隔(秒)") angry_duration: float = Field(default=300.0, ge=10.0, description="愤怒状态持续时间(秒)") + angry_prompt: str = Field(default="你被人吵醒了非常生气,说话带着怒气", description="被吵醒后的愤怒提示词") class MonthlyPlanSystemConfig(ValidatedConfigBase): diff --git a/template/bot_config_template.toml b/template/bot_config_template.toml index f4f38bbe5..f5ec06493 100644 --- a/template/bot_config_template.toml +++ b/template/bot_config_template.toml @@ -1,5 +1,5 @@ [inner] -version = "6.4.2" +version = "6.4.3" #----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读---- #如果你想要修改配置文件,请递增version的值 @@ -432,6 +432,7 @@ group_mention_increment = 2.0 #"群聊艾特增加的唤醒度" decay_rate = 0.2 #"每次衰减的唤醒度数值" decay_interval = 30.0 #"唤醒度衰减间隔(秒)" angry_duration = 300.0 #"愤怒状态持续时间(秒)" +angry_prompt = "你被人吵醒了非常生气,说话带着怒气" # "被吵醒后的愤怒提示词" [cross_context] # 跨群聊上下文共享配置 # 这是总开关,用于一键启用或禁用此功能