MCPcopy
hub / github.com/dataelement/Clawith / websocket_chat

Function websocket_chat

backend/app/api/websocket.py:227–236  ·  view source on GitHub ↗

WebSocket endpoint for real-time chat with an agent.

(
    websocket: WebSocket,
    agent_id: uuid.UUID,
    token: str = Query(...),
    session_id: str = Query(None),
    lang: str = Query("en"),
)

Source from the content-addressed store, hash-verified

225
226@router.websocket("/ws/chat/{agent_id}")
227async def websocket_chat(
228 websocket: WebSocket,
229 agent_id: uuid.UUID,
230 token: str = Query(...),
231 session_id: str = Query(None),
232 lang: str = Query("en"),
233):
234 """WebSocket endpoint for real-time chat with an agent."""
235 handler = WebSocketChatHandler(websocket, agent_id, token, session_id, lang)
236 await handler.run()
237
238
239class WebSocketChatHandler:

Callers

nothing calls this directly

Calls 2

runMethod · 0.95

Tested by

no test coverage detected