Skip to content

Commit

Permalink
chore: Delete handshaking with ws
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramimashkouk committed Sep 13, 2024
1 parent 4bcb0b2 commit a24c7e3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions backend/chatsky_ui/api/api_v1/endpoints/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
2 changes: 1 addition & 1 deletion backend/chatsky_ui/api/api_v1/endpoints/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
4 changes: 2 additions & 2 deletions backend/chatsky_ui/tests/api/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)})

Expand Down
3 changes: 1 addition & 2 deletions backend/chatsky_ui/tests/e2e/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions backend/chatsky_ui/tests/integration/test_api_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a24c7e3

Please sign in to comment.