Make call_tool() return value covariant
`list` is invariant, hence handlers can't just return `list[str]`. We need to use Sequence here.
This commit is contained in:
parent
74c49c2906
commit
935fe5d1a0
1 changed files with 2 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ import contextvars
|
|||
import logging
|
||||
import warnings
|
||||
from collections.abc import Awaitable, Callable
|
||||
from typing import Any
|
||||
from typing import Any, Sequence
|
||||
|
||||
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
|
||||
from pydantic import AnyUrl
|
||||
|
|
@ -337,7 +337,7 @@ class Server:
|
|||
|
||||
def decorator(
|
||||
func: Callable[
|
||||
..., Awaitable[list[str | types.ImageContent | types.EmbeddedResource]]
|
||||
..., Awaitable[Sequence[str | types.ImageContent | types.EmbeddedResource]]
|
||||
],
|
||||
):
|
||||
logger.debug("Registering handler for CallToolRequest")
|
||||
|
|
|
|||
Loading…
Reference in a new issue