@@ -132,7 +132,9 @@ async def send_request(
132132 self ._response_streams [request_id ] = response_stream
133133
134134 jsonrpc_request = JSONRPCRequest (
135- jsonrpc = "2.0" , id = request_id , ** request .model_dump (by_alias = True , mode = "json" , exclude_none = True )
135+ jsonrpc = "2.0" ,
136+ id = request_id ,
137+ ** request .model_dump (by_alias = True , mode = "json" , exclude_none = True ),
136138 )
137139
138140 # TODO: Support progress callbacks
@@ -150,7 +152,8 @@ async def send_notification(self, notification: SendNotificationT) -> None:
150152 Emits a notification, which is a one-way message that does not expect a response.
151153 """
152154 jsonrpc_notification = JSONRPCNotification (
153- jsonrpc = "2.0" , ** notification .model_dump (by_alias = True , mode = "json" , exclude_none = True )
155+ jsonrpc = "2.0" ,
156+ ** notification .model_dump (by_alias = True , mode = "json" , exclude_none = True ),
154157 )
155158
156159 await self ._write_stream .send (JSONRPCMessage (jsonrpc_notification ))
@@ -165,7 +168,9 @@ async def _send_response(
165168 jsonrpc_response = JSONRPCResponse (
166169 jsonrpc = "2.0" ,
167170 id = request_id ,
168- result = response .model_dump (by_alias = True , mode = "json" , exclude_none = True ),
171+ result = response .model_dump (
172+ by_alias = True , mode = "json" , exclude_none = True
173+ ),
169174 )
170175 await self ._write_stream .send (JSONRPCMessage (jsonrpc_response ))
171176
@@ -180,7 +185,9 @@ async def _receive_loop(self) -> None:
180185 await self ._incoming_message_stream_writer .send (message )
181186 elif isinstance (message .root , JSONRPCRequest ):
182187 validated_request = self ._receive_request_type .model_validate (
183- message .root .model_dump (by_alias = True , mode = "json" , exclude_none = True )
188+ message .root .model_dump (
189+ by_alias = True , mode = "json" , exclude_none = True
190+ )
184191 )
185192 responder = RequestResponder (
186193 request_id = message .root .id ,
@@ -196,7 +203,9 @@ async def _receive_loop(self) -> None:
196203 await self ._incoming_message_stream_writer .send (responder )
197204 elif isinstance (message .root , JSONRPCNotification ):
198205 notification = self ._receive_notification_type .model_validate (
199- message .root .model_dump (by_alias = True , mode = "json" , exclude_none = True )
206+ message .root .model_dump (
207+ by_alias = True , mode = "json" , exclude_none = True
208+ )
200209 )
201210
202211 await self ._received_notification (notification )
0 commit comments