chore: create union for working with message content (#939)

This commit is contained in:
Luca Chang 2025-06-12 00:01:33 -07:00 • committed by GitHub
commit d69b290b65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,7 +11,7 @@ from anyio.abc import TaskStatus
from mcp.client.session import ClientSession
from mcp.server.lowlevel import Server
from mcp.shared.exceptions import McpError
from mcp.types import AudioContent, EmbeddedResource, ImageContent, TextContent
from mcp.types import Content, TextContent
@pytest.mark.anyio
@ -31,7 +31,7 @@ async def test_notification_validation_error(tmp_path: Path):
slow_request_complete = anyio.Event()
@server.call_tool()
async def slow_tool(name: str, arg) -> Sequence[TextContent | ImageContent | AudioContent | EmbeddedResource]:
async def slow_tool(name: str, arg) -> Sequence[Content]:
nonlocal request_count
request_count += 1