| | |
| | | chat_history = message.get('chatHistory', []) |
| | | message["role"] = "user" |
| | | if len(chat_history) == 0: |
| | | print("----------------------", token) |
| | | chat_history = await ragflow_service.get_session_history(token, chat_id) |
| | | if len(chat_history) == 0: |
| | | chat_history = await ragflow_service.set_session(token, agent_id, |
| | | message, chat_id, True) |
| | | # print("chat_history------------------------", chat_history) |
| | | print("chat_history------------------------", chat_history) |
| | | if len(chat_history) == 0: |
| | | result = {"message": "内部错误:创建会话失败", "type": "close"} |
| | | await websocket.send_json(result) |