@@ -666,6 +666,23 @@ export const ImageContentSchema = z
666
666
} )
667
667
. passthrough ( ) ;
668
668
669
+ /**
670
+ * An Audio provided to or from an LLM.
671
+ */
672
+ export const AudioContentSchema = z
673
+ . object ( {
674
+ type : z . literal ( "audio" ) ,
675
+ /**
676
+ * The base64-encoded audio data.
677
+ */
678
+ data : z . string ( ) . base64 ( ) ,
679
+ /**
680
+ * The MIME type of the audio. Different providers may support different audio types.
681
+ */
682
+ mimeType : z . string ( ) ,
683
+ } )
684
+ . passthrough ( ) ;
685
+
669
686
/**
670
687
* The contents of a resource, embedded into a prompt or tool call result.
671
688
*/
@@ -685,6 +702,7 @@ export const PromptMessageSchema = z
685
702
content : z . union ( [
686
703
TextContentSchema ,
687
704
ImageContentSchema ,
705
+ AudioContentSchema ,
688
706
EmbeddedResourceSchema ,
689
707
] ) ,
690
708
} )
@@ -753,7 +771,7 @@ export const ListToolsResultSchema = PaginatedResultSchema.extend({
753
771
*/
754
772
export const CallToolResultSchema = ResultSchema . extend ( {
755
773
content : z . array (
756
- z . union ( [ TextContentSchema , ImageContentSchema , EmbeddedResourceSchema ] ) ,
774
+ z . union ( [ TextContentSchema , ImageContentSchema , AudioContentSchema , EmbeddedResourceSchema ] ) ,
757
775
) ,
758
776
isError : z . boolean ( ) . default ( false ) . optional ( ) ,
759
777
} ) ;
@@ -877,7 +895,7 @@ export const ModelPreferencesSchema = z
877
895
export const SamplingMessageSchema = z
878
896
. object ( {
879
897
role : z . enum ( [ "user" , "assistant" ] ) ,
880
- content : z . union ( [ TextContentSchema , ImageContentSchema ] ) ,
898
+ content : z . union ( [ TextContentSchema , ImageContentSchema , AudioContentSchema ] ) ,
881
899
} )
882
900
. passthrough ( ) ;
883
901
@@ -931,6 +949,7 @@ export const CreateMessageResultSchema = ResultSchema.extend({
931
949
content : z . discriminatedUnion ( "type" , [
932
950
TextContentSchema ,
933
951
ImageContentSchema ,
952
+ AudioContentSchema
934
953
] ) ,
935
954
} ) ;
936
955
@@ -1195,6 +1214,7 @@ export type ListPromptsResult = Infer<typeof ListPromptsResultSchema>;
1195
1214
export type GetPromptRequest = Infer < typeof GetPromptRequestSchema > ;
1196
1215
export type TextContent = Infer < typeof TextContentSchema > ;
1197
1216
export type ImageContent = Infer < typeof ImageContentSchema > ;
1217
+ export type AudioContent = Infer < typeof AudioContentSchema > ;
1198
1218
export type EmbeddedResource = Infer < typeof EmbeddedResourceSchema > ;
1199
1219
export type PromptMessage = Infer < typeof PromptMessageSchema > ;
1200
1220
export type GetPromptResult = Infer < typeof GetPromptResultSchema > ;
0 commit comments