QA: Update requirements and refactor message handling logic etc.

This commit is contained in:
晴猫
2025-05-01 05:58:18 +09:00
parent 410c02e7ee
commit 2f669c7055
25 changed files with 578 additions and 581 deletions

View File

@@ -185,32 +185,24 @@ class InfoCatcher:
try:
# 将消息对象转换为可序列化的字典喵~
thinking_log_data = {
"chat_id": self.chat_id,
# "response_mode": self.response_mode, # 这个也删掉喵~
"trigger_text": self.trigger_response_text,
"response_text": self.response_text,
"trigger_info": {
thinking_log_data = {"chat_id": self.chat_id, "trigger_text": self.trigger_response_text,
"response_text": self.response_text, "trigger_info": {
"time": self.trigger_response_time,
"message": self.message_to_dict(self.trigger_response_message),
},
"response_info": {
}, "response_info": {
"time": self.response_time,
"message": self.response_messages,
},
"timing_results": self.timing_results,
"chat_history": self.message_list_to_dict(self.chat_history),
"chat_history_in_thinking": self.message_list_to_dict(self.chat_history_in_thinking),
"chat_history_after_response": self.message_list_to_dict(self.chat_history_after_response),
}
}, "timing_results": self.timing_results, "chat_history": self.message_list_to_dict(self.chat_history),
"chat_history_in_thinking": self.message_list_to_dict(self.chat_history_in_thinking),
"chat_history_after_response": self.message_list_to_dict(
self.chat_history_after_response), "heartflow_data": self.heartflow_data,
"reasoning_data": self.reasoning_data}
# 根据不同的响应模式添加相应的数据喵~ # 现在直接都加上去好了喵~
# if self.response_mode == "heart_flow":
# thinking_log_data["mode_specific_data"] = self.heartflow_data
# elif self.response_mode == "reasoning":
# thinking_log_data["mode_specific_data"] = self.reasoning_data
thinking_log_data["heartflow_data"] = self.heartflow_data
thinking_log_data["reasoning_data"] = self.reasoning_data
# 将数据插入到 thinking_log 集合中喵~
db.thinking_log.insert_one(thinking_log_data)