-
Notifications
You must be signed in to change notification settings - Fork 991
Update tests to be compatible with new OpenAI, MistralAI and MCP versions #2094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,7 +208,7 @@ async def _sampling_callback( | |
) | ||
|
||
def _map_tool_result_part( | ||
self, part: mcp_types.Content | ||
self, part: mcp_types.ContentBlock | ||
) -> str | messages.BinaryContent | dict[str, Any] | list[Any]: | ||
# See https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx#return-values | ||
|
||
|
@@ -239,6 +239,13 @@ def _map_tool_result_part( | |
) | ||
else: | ||
assert_never(resource) | ||
elif isinstance(part, mcp_types.ResourceLink): | ||
return { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the expectation that this resource link is sent straight to the model as JSON, or are we supposed to handle it somehow and pass the actual resource? If it's supposed to be JSON, we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DouweM I'm not sure either. So I have open an question in Github about the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @medaminezghal I've asked a followup question: modelcontextprotocol/modelcontextprotocol#872 (reply in thread) |
||
'type': 'resource_link', | ||
'uri': part.uri, | ||
'name': part.name, | ||
'mimeType': part.mimeType, | ||
} | ||
else: | ||
assert_never(part) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mcp.types.Content
is deprecatedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
ResourceLink
According to this test.