| | |
| | | session_id=chat_id, |
| | | name=question, |
| | | agent_id=agent_id, |
| | | agent_type=AgentType.BASIC |
| | | agent_type=AgentType.BASIC, |
| | | user_id=current_user.id |
| | | ) |
| | | if not question: |
| | | await websocket.send_json({"message": "Invalid request", "type": "error"}) |
| | |
| | | if file_name: |
| | | excel_url = f"/api/files/download/?agent_id=basic_question_talk&file_id={file_name}&file_type=word" |
| | | result = {"message": output, "type": "message", "file_url": excel_url} |
| | | SessionService(db).update_session(session_id=chat_id, is_incr=1, message={"role":"assistant", "content": result}) |
| | | await websocket.send_json(result | data) |
| | | except json.JSONDecodeError as e: |
| | | print(f"Error decoding JSON: {e}") |