Update content according to latest spec (#513)

* Update content according to latest spec

* Add Title to a bunch of types

* Add _meta to lots of types

* Address feedback, more cleanup, fix NAOT test failure
This commit is contained in:
Stephen Toub 2025-06-16 19:39:41 -04:00 • committed by GitHub
commit 2bcff315f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,7 +26,7 @@ namespace ModelContextProtocol.Protocol;
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
/// </para>
/// </remarks>
public class PromptMessage
public sealed class PromptMessage
{
/// <summary>
/// Gets or sets the content of the message, which can be text, image, audio, or an embedded resource.
@ -34,10 +34,10 @@ public class PromptMessage
/// <remarks>
/// The <see cref="Content"/> object contains all the message payload, whether it's simple text,
/// base64-encoded binary data (for images/audio), or a reference to an embedded resource.
/// The <see cref="Content.Type"/> property indicates the specific content type.
/// The <see cref="ContentBlock.Type"/> property indicates the specific content type.
/// </remarks>
[JsonPropertyName("content")]
public Content Content { get; set; } = new();
public ContentBlock Content { get; set; } = new TextContentBlock { Text = "" };
/// <summary>
/// Gets or sets the role of the message sender, specifying whether it's from a "user" or an "assistant".