Class MessageContent
-
- All Implemented Interfaces:
public final class MessageContent
References an image File in the content of a message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
MessageContent.Visitor
An interface that defines how to map each variant of MessageContent to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ImageFileContentBlock>
imageFile()
References an image File in the content of a message. final Optional<ImageUrlContentBlock>
imageUrl()
References an image URL in the content of a message. final Optional<TextContentBlock>
text()
The text content that is part of a message. final Optional<RefusalContentBlock>
refusal()
The refusal content generated by the assistant. final Boolean
isImageFile()
final Boolean
isImageUrl()
final Boolean
isText()
final Boolean
isRefusal()
final ImageFileContentBlock
asImageFile()
References an image File in the content of a message. final ImageUrlContentBlock
asImageUrl()
References an image URL in the content of a message. final TextContentBlock
asText()
The text content that is part of a message. final RefusalContentBlock
asRefusal()
The refusal content generated by the assistant. final Optional<JsonValue>
_json()
final <T extends Any> T
accept(MessageContent.Visitor<T> visitor)
final MessageContent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static MessageContent
ofImageFile(ImageFileContentBlock imageFile)
References an image File in the content of a message. final static MessageContent
ofImageUrl(ImageUrlContentBlock imageUrl)
References an image URL in the content of a message. final static MessageContent
ofText(TextContentBlock text)
The text content that is part of a message. final static MessageContent
ofRefusal(RefusalContentBlock refusal)
The refusal content generated by the assistant. -
-
Method Detail
-
imageFile
final Optional<ImageFileContentBlock> imageFile()
References an image File in the content of a message.
-
imageUrl
final Optional<ImageUrlContentBlock> imageUrl()
References an image URL in the content of a message.
-
text
final Optional<TextContentBlock> text()
The text content that is part of a message.
-
refusal
final Optional<RefusalContentBlock> refusal()
The refusal content generated by the assistant.
-
isImageFile
final Boolean isImageFile()
-
isImageUrl
final Boolean isImageUrl()
-
asImageFile
final ImageFileContentBlock asImageFile()
References an image File in the content of a message.
-
asImageUrl
final ImageUrlContentBlock asImageUrl()
References an image URL in the content of a message.
-
asText
final TextContentBlock asText()
The text content that is part of a message.
-
asRefusal
final RefusalContentBlock asRefusal()
The refusal content generated by the assistant.
-
accept
final <T extends Any> T accept(MessageContent.Visitor<T> visitor)
-
validate
final MessageContent validate()
-
ofImageFile
final static MessageContent ofImageFile(ImageFileContentBlock imageFile)
References an image File in the content of a message.
-
ofImageUrl
final static MessageContent ofImageUrl(ImageUrlContentBlock imageUrl)
References an image URL in the content of a message.
-
ofText
final static MessageContent ofText(TextContentBlock text)
The text content that is part of a message.
-
ofRefusal
final static MessageContent ofRefusal(RefusalContentBlock refusal)
The refusal content generated by the assistant.
-
-
-
-