| | |
| | | from app.service.basic import BasicService |
| | | from app.service.ragflow import RagflowService |
| | | from app.service.service_token import get_bisheng_token, get_ragflow_token |
| | | from app.service.session import SessionService |
| | | |
| | | router = APIRouter() |
| | | |
| | |
| | | # 接收前端消息 |
| | | message = await websocket.receive_json() |
| | | question = message.get("message") |
| | | SessionService(db).create_session( |
| | | session_id=chat_id, |
| | | name=question, |
| | | agent_id=agent_id, |
| | | agent_type=AgentType.BASIC |
| | | ) |
| | | if not question: |
| | | await websocket.send_json({"message": "Invalid request", "type": "error"}) |
| | | continue |
| | |
| | | data = json.loads(text) |
| | | output = data.get("output", "") |
| | | excel_name = data.get("excel_name", "") |
| | | image_name = data.get("excel_name", "") |
| | | image_name = data.get("image_name", "") |
| | | excel_url = None |
| | | image_url = None |
| | | if excel_name: |