Package com.openai.models
Interface MessageContent.Visitor
-
- All Implemented Interfaces:
public interface MessageContent.Visitor<T extends Object>
An interface that defines how to map each variant of MessageContent to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract T
visitImageFile(ImageFileContentBlock imageFile)
References an image File in the content of a message. abstract T
visitImageUrl(ImageUrlContentBlock imageUrl)
References an image URL in the content of a message. abstract T
visitText(TextContentBlock text)
The text content that is part of a message. abstract T
visitRefusal(RefusalContentBlock refusal)
The refusal content generated by the assistant. T
unknown(JsonValue json)
Maps an unknown variant of MessageContent to a value of type T. -
-
Method Detail
-
visitImageFile
abstract T visitImageFile(ImageFileContentBlock imageFile)
References an image File in the content of a message.
-
visitImageUrl
abstract T visitImageUrl(ImageUrlContentBlock imageUrl)
References an image URL in the content of a message.
-
visitText
abstract T visitText(TextContentBlock text)
The text content that is part of a message.
-
visitRefusal
abstract T visitRefusal(RefusalContentBlock refusal)
The refusal content generated by the assistant.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of MessageContent to a value of type T.
An instance of MessageContent can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-