Browse Source

Merge branch 'master' of http://192.168.5.5:10010/r/rag-gateway

zhaoqingang 1 year ago
parent
commit
1441627975
2 changed files with 2 additions and 3 deletions
  1. 2 1
      app/api/chat.py
  2. 0 2
      app/api/excel.py

+ 2 - 1
app/api/chat.py

@@ -82,7 +82,8 @@ async def handle_client(websocket: WebSocket,
                                     result = {"message": "内部错误:" + answer, "type": "message"}
                                 else:  # 正常输出
                                     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}")

+ 0 - 2
app/api/excel.py

@@ -77,9 +77,7 @@ async def ws_excel(websocket: WebSocket):
         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: