| | |
| | | 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}") |
| | |
| | | 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: |