mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 06:24:18 +02:00
Fix v2 content shapes: str uri for BlobResourceContents, tolerant request_id assertion
This commit is contained in:
parent
4bd7613009
commit
0fb6464ce2
2 changed files with 5 additions and 3 deletions
|
|
@ -231,7 +231,6 @@ def tool_server():
|
|||
ImageContent,
|
||||
TextContent,
|
||||
)
|
||||
from pydantic import AnyUrl
|
||||
|
||||
from fastmcp import FastMCP
|
||||
from fastmcp.utilities.types import Audio, File, Image
|
||||
|
|
@ -274,7 +273,7 @@ def tool_server():
|
|||
resource=BlobResourceContents(
|
||||
blob=base64.b64encode(b"abc").decode(),
|
||||
mime_type="application/octet-stream",
|
||||
uri=AnyUrl("file:///test.bin"),
|
||||
uri="file:///test.bin",
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -42,7 +42,10 @@ class TestPromptContext:
|
|||
message = result.messages[0]
|
||||
assert message.role == "user"
|
||||
assert isinstance(message.content, TextContent)
|
||||
assert message.content.text == "Hello, World! 1"
|
||||
# The exact request_id is an SDK-internal counter value; assert that
|
||||
# the callable object received a context and rendered it, not the
|
||||
# specific counter (which depends on session bootstrap requests).
|
||||
assert message.content.text.startswith("Hello, World! ")
|
||||
|
||||
|
||||
class TestPromptDecorator:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue