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

This commit is contained in:
github-actions[bot]
2025-06-23 04:58:15 +00:00
parent 91ba369433
commit 20fe9cca64
2 changed files with 26 additions and 24 deletions

View File

@@ -570,9 +570,7 @@ def build_readable_messages(
# 获取最新消息之后的第一个动作记录 # 获取最新消息之后的第一个动作记录
action_after_latest = ( action_after_latest = (
ActionRecords.select() ActionRecords.select()
.where( .where((ActionRecords.time > max_time) & (ActionRecords.chat_id == chat_id))
(ActionRecords.time > max_time) & (ActionRecords.chat_id == chat_id)
)
.order_by(ActionRecords.time) .order_by(ActionRecords.time)
.limit(1) .limit(1)
) )

View File

@@ -197,7 +197,9 @@ class NoReplyAction(BaseAction):
# 检查是否超时 # 检查是否超时
if elapsed_time >= self._max_timeout: if elapsed_time >= self._max_timeout:
logger.info(f"{self.log_prefix} 达到最大等待时间{self._max_timeout}秒,结束等待") logger.info(f"{self.log_prefix} 达到最大等待时间{self._max_timeout}秒,结束等待")
exit_reason = f"{global_config.bot.nickname}(你)等待了{self._max_timeout}秒,可以考虑一下是否要进行回复" exit_reason = (
f"{global_config.bot.nickname}(你)等待了{self._max_timeout}秒,可以考虑一下是否要进行回复"
)
await self.store_action_info( await self.store_action_info(
action_build_into_prompt=True, action_build_into_prompt=True,
action_prompt_display=exit_reason, action_prompt_display=exit_reason,
@@ -288,7 +290,7 @@ class NoReplyAction(BaseAction):
prompt=judge_prompt, prompt=judge_prompt,
model_config=small_model, model_config=small_model,
request_type="plugin.no_reply_judge", request_type="plugin.no_reply_judge",
temperature=0.7 # 进一步降低温度提高JSON输出的一致性和准确性 temperature=0.7, # 进一步降低温度提高JSON输出的一致性和准确性
) )
# 更新上次判断时间 # 更新上次判断时间
@@ -301,7 +303,9 @@ class NoReplyAction(BaseAction):
# 解析LLM的JSON响应提取判断结果和理由 # 解析LLM的JSON响应提取判断结果和理由
judge_result, reason = self._parse_llm_judge_response(response) judge_result, reason = self._parse_llm_judge_response(response)
logger.info(f"{self.log_prefix} JSON解析结果 - 判断: {judge_result}, 理由: {reason}") logger.info(
f"{self.log_prefix} JSON解析结果 - 判断: {judge_result}, 理由: {reason}"
)
if judge_result == "需要回复": if judge_result == "需要回复":
logger.info(f"{self.log_prefix} 模型判断需要回复,结束等待") logger.info(f"{self.log_prefix} 模型判断需要回复,结束等待")