|
10 | 10 | from mcp.server.fastmcp import Context, FastMCP |
11 | 11 | from mcp.server.fastmcp.prompts.base import Message, UserMessage |
12 | 12 | from mcp.server.fastmcp.resources import FileResource, FunctionResource |
13 | | -from mcp.server.fastmcp.utilities.types import Image, Audio |
| 13 | +from mcp.server.fastmcp.utilities.types import Audio, Image |
14 | 14 | from mcp.server.session import ServerSession |
15 | 15 | from mcp.shared.exceptions import McpError |
16 | 16 | from mcp.shared.memory import ( |
@@ -342,7 +342,7 @@ async def test_tool_audio_suffix_detection(self, tmp_path: Path, filename: str, |
342 | 342 | """Test that Audio helper correctly detects MIME types from file suffixes""" |
343 | 343 | mcp = FastMCP() |
344 | 344 | mcp.add_tool(audio_tool_fn) |
345 | | - |
| 345 | + |
346 | 346 | # Create a test audio file with the specific extension |
347 | 347 | audio_path = tmp_path / filename |
348 | 348 | audio_path.write_bytes(b"fake audio data") |
@@ -397,15 +397,14 @@ async def test_tool_mixed_list_with_audio_and_image(self, tmp_path: Path): |
397 | 397 | image_path = tmp_path / "test.png" |
398 | 398 | image_path.write_bytes(b"test image data") |
399 | 399 |
|
400 | | - # Create a test audio |
| 400 | + # Create a test audio |
401 | 401 | audio_path = tmp_path / "test.wav" |
402 | 402 | audio_path.write_bytes(b"test audio data") |
403 | 403 |
|
404 | 404 | # TODO(Marcelo): It seems if we add the proper type hint, it generates an invalid JSON schema. |
405 | 405 | # We need to fix this. |
406 | 406 | def mixed_list_fn() -> list: # type: ignore |
407 | 407 | return [ # type: ignore |
408 | | - |
409 | 408 | "text message", |
410 | 409 | Image(image_path), |
411 | 410 | Audio(audio_path), |
|
0 commit comments