Apply suggestions from code review

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
This commit is contained in:
Henry Mao 2025-03-06 20:12:51 +08:00 • committed by GitHub
commit fc021eea76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,8 +59,7 @@ async def websocket_client(
try:
async for raw_text in ws:
try:
data = json.loads(raw_text)
message = types.JSONRPCMessage.model_validate(data)
message = types.JSONRPCMessage.model_validate_json(raw_text)
await read_stream_send.send(message)
except Exception as exc:
# If JSON parse or model validation fails, send the exception