Package io.openliberty.mcp.content
Record Class AudioContent
java.lang.Object
java.lang.Record
io.openliberty.mcp.content.AudioContent
- Record Components:
data- a base64-encoded string representing the audio data (must not benull)mimeType- the mime type of the audio (must not benull)_meta- the optional metadata (may benull)annotations- the optional annotations (may benull)
- All Implemented Interfaces:
Content
public record AudioContent(String data, String mimeType, Map<MetaKey,Object> _meta, Content.Annotations annotations)
extends Record
implements Content
An audio content provided to or from an LLM.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.openliberty.mcp.content.Content
Content.Annotations, Content.Type -
Constructor Summary
ConstructorsConstructorDescriptionAudioContent(String data, String mimeType) AudioContent(String data, String mimeType, Map<MetaKey, Object> _meta, Content.Annotations annotations) Creates an instance of aAudioContentrecord class. -
Method Summary
Modifier and TypeMethodDescription_meta()Returns the value of the_metarecord component.Returns the value of theannotationsrecord component.asAudio()Casts and returns this object as an audio content, or throws anIllegalArgumentExceptionif the content object does not represent aAudioContent.data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mimeType()Returns the value of themimeTyperecord component.final StringtoString()Returns a string representation of this record class.type()
-
Constructor Details
-
AudioContent
-
AudioContent
public AudioContent(String data, String mimeType, Map<MetaKey, Object> _meta, Content.Annotations annotations) Creates an instance of aAudioContentrecord class.- Parameters:
data- the value for thedatarecord componentmimeType- the value for themimeTyperecord component_meta- the value for the_metarecord componentannotations- the value for theannotationsrecord component
-
-
Method Details
-
type
-
asAudio
Description copied from interface:ContentCasts and returns this object as an audio content, or throws anIllegalArgumentExceptionif the content object does not represent aAudioContent. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
mimeType
Returns the value of themimeTyperecord component.- Returns:
- the value of the
mimeTyperecord component
-
_meta
Returns the value of the_metarecord component.- Returns:
- the value of the
_metarecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceContent- Returns:
- the value of the
annotationsrecord component
-