From 7be58d7783c8ef4b0b10c384dcd76d6b011f0817 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 30 十月 2024 10:04:00 +0800
Subject: [PATCH] fix报告生成

---
 app/service/bisheng.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/service/bisheng.py b/app/service/bisheng.py
index d56a00d..e7c92fa 100644
--- a/app/service/bisheng.py
+++ b/app/service/bisheng.py
@@ -81,13 +81,12 @@
             data = self._check_response(response)
             return data
 
-    async def upload(self, token: str, file: bytes) -> dict:
+    async def upload(self, token: str, filename: str, file: bytes) -> dict:
         url = f"{self.base_url}/api/v1/knowledge/upload"
         headers = {'cookie': f"access_token_cookie={token};"}
 
         # 鍒涘缓琛ㄥ崟鏁版嵁锛屽寘鍚枃浠�
-        files = {"file": ("file", file)}  # 浣跨敤榛樿鏂囦欢鍚� "file"
-
+        files = {"file": (filename, file)}
         async with httpx.AsyncClient() as client:
             response = await client.post(url, headers=headers, files=files)
             data = self._check_response(response)

--
Gitblit v1.8.0