Package io.openliberty.mcp.content
Interface Content
- All Known Implementing Classes:
AudioContent,ImageContent,TextContent
A content provided to or from an LLM.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault AudioContentasAudio()Casts and returns this object as an audio content, or throws anIllegalArgumentExceptionif the content object does not represent aAudioContent.default ImageContentasImage()Casts and returns this object as an image content, or throws anIllegalArgumentExceptionif the content object does not represent aImageContent.default TextContentasText()Casts and returns this object as a text content, or throws anIllegalArgumentExceptionif the content object does not represent aTextContent.default StringgetType()type()
-
Method Details
-
type
Content.Type type()- Returns:
- the type of the content
-
asText
Casts and returns this object as a text content, or throws anIllegalArgumentExceptionif the content object does not represent aTextContent.- Returns:
- the text content
-
asImage
Casts and returns this object as an image content, or throws anIllegalArgumentExceptionif the content object does not represent aImageContent.- Returns:
- the image content
-
asAudio
Casts and returns this object as an audio content, or throws anIllegalArgumentExceptionif the content object does not represent aAudioContent.- Returns:
- the audio content
-
getType
-