Skip to content

Commit 15f292a

Browse files
committed
add AudioContent to McpSchema
Signed-off-by: jitokim <pigberger70@gmail.com>
1 parent 41c6bd9 commit 15f292a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

mcp/src/main/java/io/modelcontextprotocol/spec/McpSchema.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,9 @@ public record CompleteCompletion(
12541254
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
12551255
@JsonSubTypes({ @JsonSubTypes.Type(value = TextContent.class, name = "text"),
12561256
@JsonSubTypes.Type(value = ImageContent.class, name = "image"),
1257+
@JsonSubTypes.Type(value = AudioContent.class, name = "audio"),
12571258
@JsonSubTypes.Type(value = EmbeddedResource.class, name = "resource") })
1258-
public sealed interface Content permits TextContent, ImageContent, EmbeddedResource {
1259+
public sealed interface Content permits TextContent, ImageContent, AudioContent, EmbeddedResource {
12591260

12601261
default String type() {
12611262
if (this instanceof TextContent) {
@@ -1264,6 +1265,9 @@ default String type() {
12641265
else if (this instanceof ImageContent) {
12651266
return "image";
12661267
}
1268+
else if (this instanceof AudioContent) {
1269+
return "audio";
1270+
}
12671271
else if (this instanceof EmbeddedResource) {
12681272
return "resource";
12691273
}
@@ -1293,6 +1297,15 @@ public record ImageContent( // @formatter:off
12931297
@JsonProperty("mimeType") String mimeType) implements Content { // @formatter:on
12941298
}
12951299

1300+
@JsonInclude(JsonInclude.Include.NON_ABSENT)
1301+
@JsonIgnoreProperties(ignoreUnknown = true)
1302+
public record AudioContent( // @formatter:off
1303+
@JsonProperty("audience") List<Role> audience,
1304+
@JsonProperty("priority") Double priority,
1305+
@JsonProperty("data") String data,
1306+
@JsonProperty("mimeType") String mimeType) implements Content { // @formatter:on
1307+
}
1308+
12961309
@JsonInclude(JsonInclude.Include.NON_ABSENT)
12971310
@JsonIgnoreProperties(ignoreUnknown = true)
12981311
public record EmbeddedResource( // @formatter:off

0 commit comments

Comments
 (0)