Spaces:
Running

michdubai commited on
Commit
1997a8d
·
verified ·
1 Parent(s): deec311

Upload websocket.py

Browse files
Files changed (1) hide show
  1. backend/routes/websocket.py +3 -0
backend/routes/websocket.py CHANGED
@@ -121,6 +121,9 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str):
121
  except asyncio.CancelledError:
122
  pass
123
 
 
 
 
124
  # Check if we should reconnect
125
  connection_alive = await gemini.check_connection()
126
  print(
 
121
  except asyncio.CancelledError:
122
  pass
123
 
124
+ # Refresh reference in case receive_from_client swapped the connection (e.g., model switch)
125
+ gemini = connections.get(client_id, gemini)
126
+
127
  # Check if we should reconnect
128
  connection_alive = await gemini.check_connection()
129
  print(