From b4acf278db581ce5e70b513407b70db2d9b29b23 Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期二, 07 一月 2025 17:33:32 +0800
Subject: [PATCH] 报告生成
---
app/service/difyService.py | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/app/service/difyService.py b/app/service/difyService.py
index 93bc62b..3731b51 100644
--- a/app/service/difyService.py
+++ b/app/service/difyService.py
@@ -65,28 +65,22 @@
raise Exception("Authorization header not found in response")
return authorization
- async def chat(self, token: str, user_id: int, message: str, upload_file_id: str, conversation_id: str):
+ async def chat(self, token: str, user_id: int, message: str, files: list, conversation_id: str, inputs:dict):
target_url = f"{self.base_url}/v1/chat-messages"
- files = []
- if upload_file_id:
- files = [
- {
- "type": "image",
- "transfer_method": "local_file",
- "url": "",
- "upload_file_id": upload_file_id
- }
- ]
data = {
- "inputs": {},
+ "inputs": inputs,
"query": message,
"response_mode": "streaming",
"conversation_id": conversation_id,
"user": str(user_id),
"files": files
}
-
+ # if parent_message_id:
+ # data["parent_message_id"] = parent_message_id
+ # print("----------------------------------------------")
+ # print(data)
+ # print("-----------------------------------------------")
async with httpx.AsyncClient(timeout=300.0) as client:
headers = {
'Content-Type': 'application/json',
--
Gitblit v1.8.0