| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5cbea24 commit 3e0ab1e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ | |||
| 8 | 8 | import httpx | |
| 9 | 9 | from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream | |
| 10 | 10 | from pydantic import BaseModel | |
| 11 | + from typing_extensions import Self | ||
| 11 | 12 | ||
| 12 | 13 | from mcp.shared.exceptions import McpError | |
| 13 | 14 | from mcp.types import ( | |
@@ -60,7 +61,7 @@ def __init__( | |||
| 60 | 61 | request_id: RequestId, | |
| 61 | 62 | request_meta: RequestParams.Meta | None, | |
| 62 | 63 | request: ReceiveRequestT, | |
| 63 | - session: "BaseSession", | ||
| 64 | + session: "BaseSession[SendRequestT, SendNotificationT, SendResultT, ReceiveRequestT, ReceiveNotificationT]", | ||
| 64 | 65 | on_complete: Callable[["RequestResponder[ReceiveRequestT, SendResultT]"], Any], | |
| 65 | 66 | ) -> None: | |
| 66 | 67 | self.request_id = request_id | |
@@ -134,7 +135,6 @@ def cancelled(self) -> bool: | |||
| 134 | 135 | ||
| 135 | 136 | ||
| 136 | 137 | class BaseSession( | |
| 137 | - AbstractAsyncContextManager, | ||
| 138 | 138 | Generic[ | |
| 139 | 139 | SendRequestT, | |
| 140 | 140 | SendNotificationT, | |
@@ -183,7 +183,7 @@ def __init__( | |||
| 183 | 183 | ]() | |
| 184 | 184 | ) | |
| 185 | 185 | ||
| 186 | - async def __aenter__(self): | ||
| 186 | + async def __aenter__(self) -> Self: | ||
| 187 | 187 | self._task_group = anyio.create_task_group() | |
| 188 | 188 | await self._task_group.__aenter__() | |
| 189 | 189 | self._task_group.start_soon(self._receive_loop) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments