优化了群总结prompt,减少了总结相关内容的有效性。

This commit is contained in:
liuwei
2025-02-20 15:46:13 +08:00
parent ac89540599
commit f791b9c5d6
2 changed files with 11 additions and 9 deletions

View File

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

View File

@@ -1,7 +1,6 @@
import requests import requests
import json import json
# 解析JSON # 解析JSON
def extract_content(data_string): def extract_content(data_string):
try: try: