xuyonghao
2024-11-07 bd3d8532cf25adfe955fb1666a6a44d27aa1cb8e
将reference发送给前端,并修改合并脚本。
2个文件已修改
5 ■■■■■ 已修改文件
app/api/chat.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/api/excel.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/api/chat.py
@@ -82,7 +82,8 @@
                                    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}")
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: