diff --git a/message_storage/message_to_db.py b/message_storage/message_to_db.py index 86b3df3..c5ea1df 100644 --- a/message_storage/message_to_db.py +++ b/message_storage/message_to_db.py @@ -2,6 +2,8 @@ import pymysql from datetime import datetime, timedelta import redis +from message_summary.message_summary_4o import message_summary + # 配置数据库连接 db_config = { 'host': '192.168.2.32', # 替换为你的MariaDB服务器地址 @@ -97,11 +99,12 @@ def get_messages(group_id, all_contacts: dict): # 示例用法 if __name__ == "__main__": - group_id = 'XXX@123123' - timestamp_str = "2025-02-06 11:15:28" - sender = "XXX" - content = "This is a test message with a string timestamp." - message_type = "text" - attachment_url = "http://example.com/attachment.pdf" # 可以为None如果没有附件 - - archive_message(group_id, timestamp_str, sender, content, message_type, attachment_url) + # group_id = 'XXX@123123' + # timestamp_str = "2025-02-06 11:15:28" + # sender = "XXX" + # content = "This is a test message with a string timestamp." + # message_type = "text" + # attachment_url = "http://example.com/attachment.pdf" # 可以为None如果没有附件 + # + # archive_message(group_id, timestamp_str, sender, content, message_type, attachment_url) + message_summary(get_messages("45317011307@chatroom", {})) diff --git a/message_summary/message_summary_4o.py b/message_summary/message_summary_4o.py index 9485cf4..c131be3 100644 --- a/message_summary/message_summary_4o.py +++ b/message_summary/message_summary_4o.py @@ -1,7 +1,6 @@ import requests import json - # 解析JSON def extract_content(data_string): try: