File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 99 CreateMessageRequestParams ,
1010 CreateMessageResult ,
1111 CreateMessageResultWithTools ,
12+ ImageContent ,
1213 Implementation ,
1314 InitializeRequest ,
1415 InitializeRequestParams ,
1516 JSONRPCMessage ,
1617 JSONRPCRequest ,
1718 ListToolsResult ,
19+ PromptReference ,
1820 SamplingCapability ,
1921 SamplingMessage ,
2022 TextContent ,
@@ -71,6 +73,17 @@ async def test_method_initialization():
7173 assert initialize_request .params .protocolVersion == LATEST_PROTOCOL_VERSION
7274
7375
76+ def test_content_type_literal_defaults ():
77+ """Content types should default their Literal type field.
78+
79+ This allows instantiation without explicitly passing the type discriminator,
80+ e.g., TextContent(text="hello") instead of TextContent(type="text", text="hello").
81+ """
82+ assert TextContent (text = "hello" ).type == "text"
83+ assert ImageContent (data = "base64" , mimeType = "image/png" ).type == "image"
84+ assert PromptReference (name = "test" ).type == "ref/prompt"
85+
86+
7487@pytest .mark .anyio
7588async def test_tool_use_content ():
7689 """Test ToolUseContent type for SEP-1577."""
You can’t perform that action at this time.
0 commit comments