From 383c21560fcb7012cd2e5b15d559e46d038c87b0 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期二, 25 二月 2025 09:54:43 +0800 Subject: [PATCH] 增加设备分析 --- app/api/chat.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/chat.py b/app/api/chat.py index 5ca3277..f6153df 100644 --- a/app/api/chat.py +++ b/app/api/chat.py @@ -11,7 +11,8 @@ from app.api import get_current_user_websocket from app.config.config import settings from app.config.const import IMAGE_TO_TEXT, DOCUMENT_TO_REPORT, DOCUMENT_TO_CLEANING, DOCUMENT_IA_QUESTIONS, \ - DOCUMENT_TO_REPORT_TITLE, DOCUMENT_TO_TITLE, DOCUMENT_TO_PAPER, DOCUMENT_IA_QUESTIONS_DS + DOCUMENT_TO_REPORT_TITLE, DOCUMENT_TO_TITLE, DOCUMENT_TO_PAPER, DOCUMENT_IA_QUESTIONS_DS, \ + DOCUMENT_IA_QUESTIONS_EQUIPMENT from app.models import MenuCapacityModel from app.models.agent_model import AgentModel, AgentType from app.models.base_model import get_db @@ -39,6 +40,7 @@ print(f"Client {agent_id} connected") agent = db.query(MenuCapacityModel).filter(MenuCapacityModel.chat_id == agent_id).first() if not agent: + print("Agent not found") agent = db.query(AgentModel).filter(AgentModel.id == agent_id).first() agent_type = agent.agent_type chat_type = agent.type @@ -808,10 +810,11 @@ result = {"message": f"鍐呴儴閿欒锛� {e2}", "type": "close"} await websocket.send_json(result) print(f"Error process message of ragflow: {e2}") - elif chat_type == "documentIa" or chat_type == "documentIaDs": + elif chat_type == "documentIa" or chat_type == "documentIaDs" or chat_type == "documentIaEq": token_dict = { "documentIa": DOCUMENT_IA_QUESTIONS, "documentIaDs": DOCUMENT_IA_QUESTIONS_DS, + "documentIaEq": DOCUMENT_IA_QUESTIONS_EQUIPMENT, } token = DfTokenDao(db).get_token_by_id(token_dict[chat_type]) # print(token) -- Gitblit v1.8.0