Strict types on the client side (#285)

This commit is contained in:
Marcelo Trylesinski 2025-03-14 11:56:48 +01:00 • committed by GitHub
commit 97201cce59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,18 +76,12 @@ class ClientSession(
self._list_roots_callback = list_roots_callback or _default_list_roots_callback
async def initialize(self) -> types.InitializeResult:
sampling = (
types.SamplingCapability() if self._sampling_callback is not None else None
)
roots = (
types.RootsCapability(
# TODO: Should this be based on whether we
# _will_ send notifications, or only whether
# they're supported?
listChanged=True,
)
if self._list_roots_callback is not None
else None
sampling = types.SamplingCapability()
roots = types.RootsCapability(
# TODO: Should this be based on whether we
# _will_ send notifications, or only whether
# they're supported?
listChanged=True,
)
result = await self.send_request(