| | |
| | | from app.models.base_model import get_db |
| | | from app.models.user_model import UserModel |
| | | from app.service.ragflow import RagflowService |
| | | from app.service.token import get_bisheng_token, get_ragflow_token |
| | | from app.service.service_token import get_bisheng_token, get_ragflow_token |
| | | |
| | | router = APIRouter() |
| | | |
| | |
| | | if len(chat_history) == 0: |
| | | chat_history = await ragflow_service.set_session(token, agent_id, |
| | | message, chat_id, True) |
| | | print("chat_history------------------------", chat_history) |
| | | if len(chat_history) == 0: |
| | | result = {"message": "内部错误:创建会话失败", "type": "close"} |
| | | await websocket.send_json(result) |