🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-06-23 07:37:04 +00:00
parent f7c335dd96
commit 84c89de827
2 changed files with 25 additions and 17 deletions

View File

@@ -115,8 +115,6 @@ class NormalChatConfig(ConfigBase):
willing_mode: str = "classical" willing_mode: str = "classical"
"""意愿模式""" """意愿模式"""
response_interested_rate_amplifier: float = 1.0 response_interested_rate_amplifier: float = 1.0
"""回复兴趣度放大系数""" """回复兴趣度放大系数"""

View File

@@ -301,13 +301,19 @@ class NoReplyAction(BaseAction):
elif over_count <= 10: elif over_count <= 10:
frequency_block = "你今天说话比较多,感觉有点疲惫,想要稍微休息一下。\n" frequency_block = "你今天说话比较多,感觉有点疲惫,想要稍微休息一下。\n"
elif over_count <= 20: elif over_count <= 20:
frequency_block = "你发现自己说话太多了,感觉很累,需要好好休息一下,不想频繁回复。\n" frequency_block = (
"你发现自己说话太多了,感觉很累,需要好好休息一下,不想频繁回复。\n"
)
else: else:
frequency_block = "你感到非常疲惫,今天话说得太多了,想要安静一会儿,除非有重要的事情否则不想回复。\n" frequency_block = "你感到非常疲惫,今天话说得太多了,想要安静一会儿,除非有重要的事情否则不想回复。\n"
logger.info(f"{self.log_prefix} 过去10分钟发言{bot_message_count}条,超过阈值{talk_frequency_threshold},添加疲惫提示") logger.info(
f"{self.log_prefix} 过去10分钟发言{bot_message_count}条,超过阈值{talk_frequency_threshold},添加疲惫提示"
)
else: else:
logger.info(f"{self.log_prefix} 过去10分钟发言{bot_message_count}条,未超过阈值{talk_frequency_threshold}") logger.info(
f"{self.log_prefix} 过去10分钟发言{bot_message_count}条,未超过阈值{talk_frequency_threshold}"
)
except Exception as e: except Exception as e:
logger.warning(f"{self.log_prefix} 检查发言频率时出错: {e}") logger.warning(f"{self.log_prefix} 检查发言频率时出错: {e}")
@@ -382,13 +388,17 @@ class NoReplyAction(BaseAction):
# 构建包含判断历史的详细信息 # 构建包含判断历史的详细信息
history_summary = "" history_summary = ""
if len(judge_history) > 1: if len(judge_history) > 1:
history_summary = f"\n\n判断过程:\n" history_summary = "\n\n判断过程:\n"
for i, (timestamp, past_result, past_reason) in enumerate(judge_history[:-1], 1): for i, (timestamp, past_result, past_reason) in enumerate(
judge_history[:-1], 1
):
elapsed_seconds = int(timestamp - start_time) elapsed_seconds = int(timestamp - start_time)
history_summary += f"{i}. 等待{elapsed_seconds}秒时:{past_result},理由:{past_reason}\n" history_summary += f"{i}. 等待{elapsed_seconds}秒时:{past_result},理由:{past_reason}\n"
history_summary += f"{len(judge_history)}. 等待{elapsed_time:.0f}秒时:{judge_result},理由:{reason}" history_summary += f"{len(judge_history)}. 等待{elapsed_time:.0f}秒时:{judge_result},理由:{reason}"
full_prompt = f"{global_config.bot.nickname}(你)的想法是:{reason}{history_summary}" full_prompt = (
f"{global_config.bot.nickname}(你)的想法是:{reason}{history_summary}"
)
await self.store_action_info( await self.store_action_info(
action_build_into_prompt=True, action_build_into_prompt=True,
action_prompt_display=full_prompt, action_prompt_display=full_prompt,