MCPcopy Create free account
hub / github.com/modelscope/ms-agent / handle_session_message

Function handle_session_message

webui/backend/websocket_handler.py:156–168  ·  view source on GitHub ↗

Handle incoming WebSocket messages

(session_id: str, data: Dict[str, Any],
                                 websocket: WebSocket)

Source from the content-addressed store, hash-verified

154
155
156async def handle_session_message(session_id: str, data: Dict[str, Any],
157 websocket: WebSocket):
158 """Handle incoming WebSocket messages"""
159 action = data.get('action')
160
161 if action == 'start':
162 await start_agent(session_id, data, websocket)
163 elif action == 'stop':
164 await stop_agent(session_id)
165 elif action == 'send_input':
166 await send_input(session_id, data)
167 elif action == 'get_status':
168 await send_status(session_id, websocket)
169
170
171async def start_agent(session_id: str, data: Dict[str, Any],

Callers 1

websocket_sessionFunction · 0.85

Calls 5

start_agentFunction · 0.85
stop_agentFunction · 0.85
send_inputFunction · 0.85
send_statusFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected