Skip to content

Commit 9f26b28

Browse files
committed
Trying to fix tests
1 parent a46222f commit 9f26b28

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

pydantic_ai_slim/pydantic_ai/toolsets/fastmcp.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
from asyncio import Lock
55
from contextlib import AsyncExitStack
66
from enum import Enum
7-
from typing import TYPE_CHECKING, Any, Self
7+
from typing import TYPE_CHECKING, Any
88

9-
from mcp.types import (
10-
AudioContent,
11-
ContentBlock,
12-
ImageContent,
13-
TextContent,
14-
Tool as MCPTool,
15-
)
9+
from typing_extensions import Self
1610

1711
from pydantic_ai.exceptions import ModelRetry
1812
from pydantic_ai.mcp import TOOL_SCHEMA_VALIDATOR, messages
@@ -26,6 +20,14 @@
2620
from fastmcp.exceptions import ToolError
2721
from fastmcp.mcp_config import MCPConfig
2822
from fastmcp.server.server import FastMCP
23+
from mcp.types import (
24+
AudioContent,
25+
ContentBlock,
26+
ImageContent,
27+
TextContent,
28+
Tool as MCPTool,
29+
)
30+
2931
except ImportError as _import_error:
3032
raise ImportError(
3133
'Please install the `fastmcp` package to use the FastMCP server, '

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ dev = [
8989
"coverage[toml]>=7.10.3",
9090
"dirty-equals>=0.9.0",
9191
"duckduckgo-search>=7.0.0",
92+
"fastmcp>=2.12.0",
9293
"inline-snapshot>=0.19.3",
9394
"pytest>=8.3.3",
9495
"pytest-examples>=0.0.18",

tests/test_fastmcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import pytest
99
from inline_snapshot import snapshot
10-
from mcp.types import TextContent
1110

1211
from pydantic_ai._run_context import RunContext
1312
from pydantic_ai.exceptions import ModelRetry
@@ -26,6 +25,7 @@
2625
from mcp.types import (
2726
AudioContent,
2827
ImageContent,
28+
TextContent,
2929
)
3030

3131
# Import the content mapping functions for testing

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)