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):
|
||||
|
||||
Reference in New Issue
Block a user