feat(config): 增加可配置的唤醒愤怒提示词
将唤醒后愤怒状态下的固定提示词修改为可在配置文件中自定义的选项,提高了灵活性。 默认值保持原有的提示词内容。
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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] # 跨群聊上下文共享配置
|
||||
# 这是总开关,用于一键启用或禁用此功能
|
||||
|
||||
Reference in New Issue
Block a user