Class BetaEasyInputMessage.Content
-
- All Implemented Interfaces:
public final class BetaEasyInputMessage.ContentText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaEasyInputMessage.Content.VisitorAn interface that defines how to map each variant of Content to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<String>textInput()A text input to the model. final Optional<List<BetaResponseInputContent>>betaResponseInputMessageContentList()A list of one or many input items to the model, containing different content types. final BooleanisTextInput()final BooleanisBetaResponseInputMessageContentList()final StringasTextInput()A text input to the model. final List<BetaResponseInputContent>asBetaResponseInputMessageContentList()A list of one or many input items to the model, containing different content types. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaEasyInputMessage.Content.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaEasyInputMessage.Contentvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaEasyInputMessage.ContentofTextInput(String textInput)A text input to the model. final static BetaEasyInputMessage.ContentofBetaResponseInputMessageContentList(List<BetaResponseInputContent> betaResponseInputMessageContentList)A list of one or many input items to the model, containing different content types. -
-
Method Detail
-
betaResponseInputMessageContentList
final Optional<List<BetaResponseInputContent>> betaResponseInputMessageContentList()
A list of one or many input items to the model, containing different content types.
-
isTextInput
final Boolean isTextInput()
-
isBetaResponseInputMessageContentList
final Boolean isBetaResponseInputMessageContentList()
-
asTextInput
final String asTextInput()
A text input to the model.
-
asBetaResponseInputMessageContentList
final List<BetaResponseInputContent> asBetaResponseInputMessageContentList()
A list of one or many input items to the model, containing different content types.
-
accept
final <T extends Any> T accept(BetaEasyInputMessage.Content.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = content.accept(new Content.Visitor<Optional<String>>() { @Override public Optional<String> visitTextInput(String textInput) { return Optional.of(textInput.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaEasyInputMessage.Content validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofTextInput
final static BetaEasyInputMessage.Content ofTextInput(String textInput)
A text input to the model.
-
ofBetaResponseInputMessageContentList
final static BetaEasyInputMessage.Content ofBetaResponseInputMessageContentList(List<BetaResponseInputContent> betaResponseInputMessageContentList)
A list of one or many input items to the model, containing different content types.
-
-
-
-