feat(chat): implement sleep pressure and insomnia system

This commit introduces a new sleep pressure and insomnia system to simulate more realistic character behavior.

Key features include:
- **Sleep Pressure**: A new metric that accumulates with each action the bot takes and decreases during scheduled sleep times.
- **Insomnia Mechanic**: When a sleep period begins, the system checks the current sleep pressure. Low pressure can lead to a higher chance of "insomnia," causing the bot to stay awake. There is also a small chance for random insomnia.
- **Insomnia State**: During insomnia, the bot enters a special state for a configurable duration. It can trigger unique proactive thoughts related to being unable to sleep, and its mood is adjusted accordingly.
- **Configuration**: All parameters, such as insomnia probability, duration, and pressure thresholds, are fully configurable.
This commit is contained in:
minecraft1024a
2025-08-27 21:02:21 +08:00
parent ff1007049d
commit ecf2df27fa
9 changed files with 231 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
[inner]
version = "6.5.3"
version = "6.5.4"
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
#如果你想要修改配置文件请递增version的值
@@ -427,7 +427,7 @@ guidelines = """
"""
[wakeup_system]
enable = true #"是否启用唤醒度系统"
enable = false #"是否启用唤醒度系统"
wakeup_threshold = 15.0 #唤醒阈值,达到此值时会被唤醒"
private_message_increment = 3.0 #"私聊消息增加的唤醒度"
group_mention_increment = 2.0 #"群聊艾特增加的唤醒度"
@@ -436,6 +436,21 @@ decay_interval = 30.0 #"唤醒度衰减间隔(秒)"
angry_duration = 300.0 #"愤怒状态持续时间(秒)"
angry_prompt = "你被人吵醒了非常生气,说话带着怒气" # "被吵醒后的愤怒提示词"
# --- 失眠机制相关参数 ---
enable_insomnia_system = true # 是否启用失眠系统
# 触发“压力不足型失眠”的睡眠压力阈值
sleep_pressure_threshold = 30.0
# 进入“深度睡眠”的睡眠压力阈值
deep_sleep_threshold = 80.0
# 压力不足时的失眠基础概率 (0.0 to 1.0)
insomnia_chance_low_pressure = 0.6
# 压力正常时的失眠基础概率 (0.0 to 1.0)
insomnia_chance_normal_pressure = 0.1
# 每次AI执行动作后增加的睡眠压力值
sleep_pressure_increment = 1.5
# 睡眠时,每分钟衰减的睡眠压力值
sleep_pressure_decay_rate = 1.5
[cross_context] # 跨群聊上下文共享配置
# 这是总开关,用于一键启用或禁用此功能
enable = false