From bd3d8532cf25adfe955fb1666a6a44d27aa1cb8e Mon Sep 17 00:00:00 2001
From: xuyonghao <898441624@qq.com>
Date: 星期四, 07 十一月 2024 15:30:32 +0800
Subject: [PATCH] 将reference发送给前端,并修改合并脚本。

---
 app/api/chat.py  |    3 ++-
 app/api/excel.py |    2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/api/chat.py b/app/api/chat.py
index f11b01e..fdcb92a 100644
--- a/app/api/chat.py
+++ b/app/api/chat.py
@@ -82,7 +82,8 @@
                                     result = {"message": "鍐呴儴閿欒锛�" + answer, "type": "message"}
                                 else:  # 姝e父杈撳嚭
                                     answer = data.get("answer", "")
-                                    result = {"message": answer, "type": "message"}
+                                    reference = data.get("reference", "")
+                                    result = {"message": answer, "type": "message", "reference": reference }
                                 await websocket.send_json(result)
                             except json.JSONDecodeError:
                                 print(f"Error decode ragflow response: {text}")
diff --git a/app/api/excel.py b/app/api/excel.py
index 629866f..77ae5fd 100644
--- a/app/api/excel.py
+++ b/app/api/excel.py
@@ -77,9 +77,7 @@
         data = await websocket.receive_text()
         try:
             if data == "\"鍚堝苟Excel\"":
-                clear_directory(EXCEL_FILES_PATH)
                 output_file_path = run_conformity()
-                clear_directory(EXCEL_FILES_PATH)
                 output_file_path = run_conformity()
                 files = os.listdir(EXCEL_FILES_PATH)
                 if files:

--
Gitblit v1.8.0