MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / handle_message

Method handle_message

server/services/websocket_manager.py:133–147  ·  view source on GitHub ↗
(self, session_id: str, message: str)

Source from the content-addressed store, hash-verified

131 logging.warning("Heartbeat request from disconnected session: %s", session_id)
132
133 async def handle_message(self, session_id: str, message: str) -> None:
134 try:
135 data = json.loads(message)
136 await self.message_handler.handle_message(session_id, data, self)
137 except json.JSONDecodeError:
138 await self.send_message(
139 session_id,
140 {"type": "error", "data": {"message": "Invalid JSON format"}},
141 )
142 except Exception as exc:
143 logging.error("Error handling message from %s: %s", session_id, exc)
144 await self.send_message(
145 session_id,
146 {"type": "error", "data": {"message": str(exc)}},
147 )

Callers

nothing calls this directly

Calls 2

send_messageMethod · 0.95
errorMethod · 0.45

Tested by

no test coverage detected