调整总结内容,将内容进行压缩,估计压缩40%;
This commit is contained in:
@@ -4,6 +4,7 @@ import os
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from message_summary.compress_chat_data import compress_chat_data
|
||||
from message_summary.markdown_to_image import convert_md_str_to_image
|
||||
|
||||
|
||||
@@ -20,14 +21,16 @@ def message_summary_dify(content):
|
||||
# Dify API配置
|
||||
api_key = "app-McGLzBhBjeBCSEi7n83MtuTo" # 请替换为实际的API密钥
|
||||
url = "http://192.168.2.240/v1/chat-messages"
|
||||
|
||||
# 生成唯一的会话ID
|
||||
conversation_id = str(uuid.uuid4())
|
||||
|
||||
content_compress = content
|
||||
try:
|
||||
content_compress = compress_chat_data(content)
|
||||
print(f"压缩内容成功:{len(content_compress)}--{len(content)}")
|
||||
except Exception as e:
|
||||
print(f"压缩内容失败:{e}")
|
||||
# 准备请求数据
|
||||
data = {
|
||||
"inputs": {},
|
||||
"query": f"请根据以下群聊记录生成一份精华总结:\n\n{content}",
|
||||
"query": f"请根据以下群聊记录生成一份精华总结:\n\n{content_compress}",
|
||||
"response_mode": "blocking", # 使用阻塞模式,直接获取完整响应
|
||||
"conversation_id": "",
|
||||
"user": "message_summary_bot",
|
||||
|
||||
Reference in New Issue
Block a user