| | |
| | | files = data.get("files", []) |
| | | steps = data.get("intermediate_steps", "") |
| | | msg = data.get("message", "") |
| | | category = data.get("category", "") |
| | | |
| | | if len(files) != 0 or (steps and last_message == "step") or msg or data["type"] == "close": |
| | | if len(files) != 0 or (msg and category != "answer") or data["type"] == "close": |
| | | if data["type"] == "close": |
| | | t = "close" |
| | | else: |
| | | t = "stream" |
| | | process_files(files, agent_id) |
| | | result = {"step_message": steps, "message": msg, "type": t, "files": files} |
| | | result = {"message": msg, "type": t, "files": files} |
| | | await websocket.send_json(result) |
| | | print(f"Forwarded to client, {chat_id}: {result}") |
| | | elif steps and last_message == "step": |
| | | result = {"step_message": steps, "type": "stream", "files": files} |
| | | await websocket.send_json(result) |
| | | |
| | | last_message = "message" if msg else "step" |
| | | |
| | |
| | | task.cancel() |
| | | try: |
| | | await task |
| | | except asyncio.CancelledError: |
| | | except asyncio.CancelledError as e: |
| | | print(f"asyncio CancelledError: {e}") |
| | | pass |
| | | |
| | | except WebSocketDisconnect as e: |
| | |
| | | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB |
| | | -----END PUBLIC KEY----- |
| | | PRIVATE_KEY: str |
| | | fetch_sgb_agent: 报告生成 |
| | | fetch_fwr_agent: 知识问答,文档智能,智能问答 |
| | | fetch_sgb_agent: 报告生成,文档智能 |
| | | fetch_fwr_agent: 知识问答,智能问答 |
| | |
| | | initial_agents = [ |
| | | ('80ee430a-e396-48c4-a12c-7c7cdf5eda51', 1, '报告生成', 'BISHENG', 'report'), |
| | | ('basic_excel_merge', 2, '报表合并', 'BASIC', 'excelMerge'), |
| | | ('bfd090d589d811efb3630242ac190006', 4, '文档智能', 'RAGFLOW', 'documentChat'), |
| | | ('bfd090d589d811efb3630242ac190006', 4, '文档智能', 'BISHENG', 'documentChat'), |
| | | ('da3451da89d911efb9490242ac190006', 3, '知识问答', 'RAGFLOW', 'knowledgeQA'), |
| | | ('e96eb7a589db11ef87d20242ac190006', 5, '智能问答', 'RAGFLOW', 'chat') |
| | | ] |