diff --git a/backend/chatsky_ui/api/api_v1/endpoints/bot.py b/backend/chatsky_ui/api/api_v1/endpoints/bot.py index 379f780..abc6a89 100644 --- a/backend/chatsky_ui/api/api_v1/endpoints/bot.py +++ b/backend/chatsky_ui/api/api_v1/endpoints/bot.py @@ -264,8 +264,6 @@ async def connect( await websocket_manager.connect(websocket) run_manager.logger.info("Websocket for run process '%s' has been opened", run_id) - await websocket.send_text("Start chatting") - output_task = asyncio.create_task( websocket_manager.send_process_output_to_websocket(run_id, run_manager, websocket) ) diff --git a/backend/chatsky_ui/api/api_v1/endpoints/flows.py b/backend/chatsky_ui/api/api_v1/endpoints/flows.py index 94b540a..8ab047b 100644 --- a/backend/chatsky_ui/api/api_v1/endpoints/flows.py +++ b/backend/chatsky_ui/api/api_v1/endpoints/flows.py @@ -18,7 +18,7 @@ async def flows_get() -> Dict[str, Union[str, Dict[str, Union[list, dict]]]]: @router.post("/") -async def flows_post(flows: Dict[str, list]) -> Dict[str, str]: +async def flows_post(flows: Dict[str, Union[list, dict]]) -> Dict[str, str]: """Write the flows to the frontend_flows.yaml file.""" await write_conf(flows, settings.frontend_flows_path) return {"status": "ok"} diff --git a/backend/chatsky_ui/tests/api/test_bot.py b/backend/chatsky_ui/tests/api/test_bot.py index 164e27d..f50529c 100644 --- a/backend/chatsky_ui/tests/api/test_bot.py +++ b/backend/chatsky_ui/tests/api/test_bot.py @@ -157,8 +157,8 @@ async def test_connect(mocker): websocket = mocker.AsyncMock() websocket_manager = mocker.AsyncMock() websocket_manager.disconnect = mocker.MagicMock() - run_manager = mocker.MagicMock() - run_process = mocker.MagicMock() + run_manager = mocker.AsyncMock() + run_process = mocker.AsyncMock() run_manager.processes = {RUN_ID: run_process} mocker.patch.object(websocket, "query_params", {"run_id": str(RUN_ID)}) diff --git a/backend/chatsky_ui/tests/e2e/test_e2e.py b/backend/chatsky_ui/tests/e2e/test_e2e.py index 38ccd98..f24567e 100644 --- a/backend/chatsky_ui/tests/e2e/test_e2e.py +++ b/backend/chatsky_ui/tests/e2e/test_e2e.py @@ -51,5 +51,4 @@ async def test_all(mocker): assert await process_manager.get_status(run_id) == Status.ALIVE async with aconnect_ws(f"http://localhost:8000/api/v1/bot/run/connect?run_id={run_id}", client) as ws: - message = await ws.receive_text() - assert message == "Start chatting" + pass diff --git a/backend/chatsky_ui/tests/integration/test_api_integration.py b/backend/chatsky_ui/tests/integration/test_api_integration.py index 81a1aa6..0ec8e02 100644 --- a/backend/chatsky_ui/tests/integration/test_api_integration.py +++ b/backend/chatsky_ui/tests/integration/test_api_integration.py @@ -206,8 +206,7 @@ async def test_connect_to_ws(mocker): assert await process_manager.get_status(run_id) == Status.ALIVE async with aconnect_ws(f"http://localhost:8000/api/v1/bot/run/connect?run_id={run_id}", client) as ws: - message = await ws.receive_text() - assert message == "Start chatting" + pass def test_search_service(client):