Package dev.tachyonmcp.api.server.domain
Interface AudioContent
- All Superinterfaces:
ContentBlock,HasMeta
An audio content block provided to or from an LLM.
The audio data is base64-encoded in data, with the corresponding
mimeType describing the encoding (e.g. audio/mp3).
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface dev.tachyonmcp.api.server.domain.ContentBlock
ContentBlock.Type -
Method Summary
Modifier and TypeMethodDescription@Nullable AnnotationsReturns the annotations for this content, ornullif none.static AudioContentCreates an audio content block with no metadata or annotations.static AudioContentbase64(String data, String mimeType, @Nullable Annotations annotations) Creates an audio content block with given annotations and no metadata.static AudioContentbase64(String data, String mimeType, @Nullable Annotations annotations, @Nullable Map<String, Object> meta) Creates an audio content block with metadata and optional annotations.static AudioContent.Builderbuilder()Creates a new builder for constructingAudioContentinstances.default voidcheck()Validates that required fields are not blank.data()Returns the base64-encoded audio data.meta()Returns the optional metadata map for protocol extensions.mimeType()Returns the MIME type of the audio content.static AudioContentDeprecated, for removal: This API element is subject to removal in a future version.static AudioContentof(String data, String mimeType, @Nullable Annotations annotations) Deprecated, for removal: This API element is subject to removal in a future version.static AudioContentof(String data, String mimeType, @Nullable Annotations annotations, @Nullable Map<String, Object> meta) Deprecated, for removal: This API element is subject to removal in a future version.default ContentBlock.Typetype()Returns the MCP protocol type discriminator for this content block variant.
-
Method Details
-
data
Returns the base64-encoded audio data.- Returns:
- the audio data as a base64 string
-
mimeType
String mimeType()Returns the MIME type of the audio content.- Returns:
- the audio MIME type
-
annotations
@Nullable Annotations annotations()Returns the annotations for this content, ornullif none.- Returns:
- the annotations, or
null
-
meta
Description copied from interface:HasMetaReturns the optional metadata map for protocol extensions. -
type
Description copied from interface:ContentBlockReturns the MCP protocol type discriminator for this content block variant.- Specified by:
typein interfaceContentBlock- Returns:
- the content type discriminator
-
check
@Check default void check()Validates that required fields are not blank.- Throws:
IllegalArgumentException- ifdataormimeTypeis blank
-
builder
Creates a new builder for constructingAudioContentinstances.- Returns:
- a new builder
-
base64
Creates an audio content block with no metadata or annotations.- Parameters:
data- the base64-encoded audio datamimeType- the audio MIME type- Returns:
- a new audio content
-
of
@Deprecated(since="1.0.0-beta.15", forRemoval=true) static AudioContent of(String data, String mimeType) Deprecated, for removal: This API element is subject to removal in a future version.Creates audio content from base64-encoded data.- Parameters:
data- the base64-encoded audio datamimeType- the audio MIME type- Returns:
- a new audio content
-
base64
Creates an audio content block with given annotations and no metadata.- Parameters:
data- the base64-encoded audio datamimeType- the audio MIME typeannotations- the annotations, ornull- Returns:
- a new audio content
-
of
@Deprecated(since="1.0.0-beta.15", forRemoval=true) static AudioContent of(String data, String mimeType, @Nullable Annotations annotations) Deprecated, for removal: This API element is subject to removal in a future version.Creates audio content from base64-encoded data with annotations.- Parameters:
data- the base64-encoded audio datamimeType- the audio MIME typeannotations- the annotations, ornull- Returns:
- a new audio content
-
base64
static AudioContent base64(String data, String mimeType, @Nullable Annotations annotations, @Nullable Map<String, Object> meta) Creates an audio content block with metadata and optional annotations.- Parameters:
data- the base64-encoded audio datamimeType- the audio MIME typeannotations- the annotations, ornullmeta- the metadata entries, ornull- Returns:
- a new audio content
-
of
@Deprecated(since="1.0.0-beta.15", forRemoval=true) static AudioContent of(String data, String mimeType, @Nullable Annotations annotations, @Nullable Map<String, Object> meta) Deprecated, for removal: This API element is subject to removal in a future version.Creates audio content from base64-encoded data with annotations and metadata.- Parameters:
data- the base64-encoded audio datamimeType- the audio MIME typeannotations- the annotations, ornullmeta- the metadata entries, ornull- Returns:
- a new audio content
-
base64(String, String)