|
36 | 36 | SendRequestT = TypeVar("SendRequestT", ClientRequest, ServerRequest) |
37 | 37 | SendResultT = TypeVar("SendResultT", ClientResult, ServerResult) |
38 | 38 | SendNotificationT = TypeVar("SendNotificationT", ClientNotification, ServerNotification) |
39 | | -SendNotificationInternalT = TypeVar( |
40 | | - "SendNotificationInternalT", |
41 | | - CancelledNotification, |
42 | | - ClientNotification, |
43 | | - ServerNotification, |
44 | | -) |
45 | 39 | ReceiveRequestT = TypeVar("ReceiveRequestT", ClientRequest, ServerRequest) |
46 | 40 | ReceiveResultT = TypeVar("ReceiveResultT", bound=BaseModel) |
47 | 41 | ReceiveNotificationT = TypeVar( |
@@ -308,7 +302,7 @@ async def send_request( |
308 | 302 | requestId=request_id, reason="cancelled" |
309 | 303 | ), |
310 | 304 | ) |
311 | | - await self._send_notification_internal( |
| 305 | + await self._send_notification( # type: ignore |
312 | 306 | notification, request_id |
313 | 307 | ) |
314 | 308 | raise McpError( |
@@ -349,16 +343,6 @@ async def send_notification( |
349 | 343 | Emits a notification, which is a one-way message that does not expect |
350 | 344 | a response. |
351 | 345 | """ |
352 | | - await self._send_notification_internal(notification, related_request_id) |
353 | | - |
354 | | - # this method is required as SendNotificationT type checking prevents |
355 | | - # internal use for sending cancelation - typechecking sorcery may be |
356 | | - # required |
357 | | - async def _send_notification_internal( |
358 | | - self, |
359 | | - notification: SendNotificationInternalT, |
360 | | - related_request_id: RequestId | None = None, |
361 | | - ) -> None: |
362 | 346 | # Some transport implementations may need to set the related_request_id |
363 | 347 | # to attribute to the notifications to the request that triggered them. |
364 | 348 | jsonrpc_notification = JSONRPCNotification( |
|
0 commit comments