refactor: split RequestContext between server and client (#1987)
This commit is contained in:
parent
050aeb6456
commit
b1f7eec3cd
1 changed files with 210 additions and 212 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Any
|
||||
from __future__ import annotations
|
||||
|
||||
import anyio
|
||||
import pytest
|
||||
|
|
@ -390,7 +390,7 @@ async def test_client_capabilities_with_custom_callbacks():
|
|||
received_capabilities = None
|
||||
|
||||
async def custom_sampling_callback( # pragma: no cover
|
||||
context: RequestContext["ClientSession", Any],
|
||||
context: RequestContext[ClientSession],
|
||||
params: types.CreateMessageRequestParams,
|
||||
) -> types.CreateMessageResult | types.ErrorData:
|
||||
return types.CreateMessageResult(
|
||||
|
|
@ -400,7 +400,7 @@ async def test_client_capabilities_with_custom_callbacks():
|
|||
)
|
||||
|
||||
async def custom_list_roots_callback( # pragma: no cover
|
||||
context: RequestContext["ClientSession", Any],
|
||||
context: RequestContext[ClientSession],
|
||||
) -> types.ListRootsResult | types.ErrorData:
|
||||
return types.ListRootsResult(roots=[])
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ async def test_client_capabilities_with_sampling_tools():
|
|||
received_capabilities = None
|
||||
|
||||
async def custom_sampling_callback( # pragma: no cover
|
||||
context: RequestContext["ClientSession", Any],
|
||||
context: RequestContext[ClientSession],
|
||||
params: types.CreateMessageRequestParams,
|
||||
) -> types.CreateMessageResult | types.ErrorData:
|
||||
return types.CreateMessageResult(
|
||||
|
|
|
|||
Loading…
Reference in a new issue