-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add resource Link #974
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
Add resource Link #974
Conversation
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.
Inline comment re Content
/ContentBlock
, but your call
src/mcp/types.py
Outdated
ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource | ||
"""A content block that can be used in prompts and tool results.""" | ||
|
||
Content = ContentBlock |
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.
Assuming this is to reduce blast radius for the PR, but if so, should we maybe leave it named Content
and then do the Content
-> ContentBlock
change in a followup, rather than having both names floating around?
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.
need to add deprecated!
|
||
|
||
class PromptMessage(BaseModel): | ||
"""Describes a message returned as part of a prompt.""" | ||
|
||
role: Role | ||
content: Content | ||
content: ContentBlock |
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.
per above comment
@@ -859,7 +872,7 @@ class CallToolRequest(Request[CallToolRequestParams, Literal["tools/call"]]): | |||
class CallToolResult(Result): | |||
"""The server's response to a tool call.""" | |||
|
|||
content: list[Content] | |||
content: list[ContentBlock] |
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.
per above comment
"""A content block that can be used in prompts and tool results.""" | ||
|
||
Content: TypeAlias = ContentBlock | ||
# """DEPRECATED: Content is deprecated, you should use ContentBlock directly.""" |
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.
leaving content just in case someone uses it from SDK and not to break them
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.
LGTM!
test failure looks like a linux flake?
|
Details: modelcontextprotocol/modelcontextprotocol#603
Closes #944