🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -149,7 +149,9 @@ class ActionPlanner:
|
||||
timestamp_mode="relative",
|
||||
read_mark=0.0,
|
||||
)
|
||||
chat_history_text += f"\n--- 以下是 {observation_info.new_messages_count} 条新消息 ---\n{new_messages_str}"
|
||||
chat_history_text += (
|
||||
f"\n--- 以下是 {observation_info.new_messages_count} 条新消息 ---\n{new_messages_str}"
|
||||
)
|
||||
# 清理消息应该由调用者或 observation_info 内部逻辑处理,这里不再调用 clear
|
||||
# if hasattr(observation_info, 'clear_unprocessed_messages'):
|
||||
# observation_info.clear_unprocessed_messages()
|
||||
@@ -302,4 +304,4 @@ end_conversation: 结束对话,对方长时间没回复或者当你觉得对
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"规划行动时调用 LLM 或处理结果出错: {str(e)}")
|
||||
return "wait", f"行动规划处理中发生错误,暂时等待: {str(e)}"
|
||||
return "wait", f"行动规划处理中发生错误,暂时等待: {str(e)}"
|
||||
|
||||
@@ -4,6 +4,7 @@ import datetime
|
||||
|
||||
# from .message_storage import MongoDBMessageStorage
|
||||
from src.plugins.utils.chat_message_builder import build_readable_messages, get_raw_msg_before_timestamp_with_chat
|
||||
|
||||
# from ...config.config import global_config
|
||||
from typing import Dict, Any
|
||||
from ..chat.message import Message
|
||||
@@ -461,4 +462,4 @@ class Conversation:
|
||||
except Exception as e:
|
||||
# 这是外层 try 对应的 except
|
||||
logger.error(f"发送消息或更新状态时失败: {str(e)}")
|
||||
self.state = ConversationState.ANALYZING # 出错也要尝试恢复状态
|
||||
self.state = ConversationState.ANALYZING # 出错也要尝试恢复状态
|
||||
|
||||
@@ -241,4 +241,4 @@ class ObservationInfo:
|
||||
self.has_unread_messages = False
|
||||
self.unprocessed_messages.clear()
|
||||
self.chat_history_count = len(self.chat_history)
|
||||
self.new_messages_count = 0
|
||||
self.new_messages_count = 0
|
||||
|
||||
@@ -381,4 +381,4 @@ class DirectMessageSender:
|
||||
await self.storage.store_message(message, chat_stream)
|
||||
logger.success(f"PFC消息已发送: {content}")
|
||||
except Exception as e:
|
||||
logger.error(f"PFC消息发送失败: {str(e)}")
|
||||
logger.error(f"PFC消息发送失败: {str(e)}")
|
||||
|
||||
@@ -182,4 +182,4 @@ class ReplyGenerator:
|
||||
Returns:
|
||||
Tuple[bool, str, bool]: (是否合适, 原因, 是否需要重新规划)
|
||||
"""
|
||||
return await self.reply_checker.check(reply, goal, chat_history, chat_history_str, retry_count)
|
||||
return await self.reply_checker.check(reply, goal, chat_history, chat_history_str, retry_count)
|
||||
|
||||
Reference in New Issue
Block a user