Class ResponseFunctionCallOutputItem
-
- All Implemented Interfaces:
public final class ResponseFunctionCallOutputItemA piece of message content, such as text, an image, or a file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseFunctionCallOutputItem.VisitorAn interface that defines how to map each variant of ResponseFunctionCallOutputItem to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ResponseInputTextContent>inputText()A text input to the model. final Optional<ResponseInputImageContent>inputImage()An image input to the model. final Optional<ResponseInputFileContent>inputFile()A file input to the model. final BooleanisInputText()final BooleanisInputImage()final BooleanisInputFile()final ResponseInputTextContentasInputText()A text input to the model. final ResponseInputImageContentasInputImage()An image input to the model. final ResponseInputFileContentasInputFile()A file input to the model. final Optional<JsonValue>_json()final <T extends Any> Taccept(ResponseFunctionCallOutputItem.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ResponseFunctionCallOutputItemvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseFunctionCallOutputItemofInputText(ResponseInputTextContent inputText)A text input to the model. final static ResponseFunctionCallOutputItemofInputImage(ResponseInputImageContent inputImage)An image input to the model. final static ResponseFunctionCallOutputItemofInputFile(ResponseInputFileContent inputFile)A file input to the model. -
-
Method Detail
-
inputText
final Optional<ResponseInputTextContent> inputText()
A text input to the model.
-
inputImage
final Optional<ResponseInputImageContent> inputImage()
An image input to the model. Learn about image inputs
-
inputFile
final Optional<ResponseInputFileContent> inputFile()
A file input to the model.
-
isInputText
final Boolean isInputText()
-
isInputImage
final Boolean isInputImage()
-
isInputFile
final Boolean isInputFile()
-
asInputText
final ResponseInputTextContent asInputText()
A text input to the model.
-
asInputImage
final ResponseInputImageContent asInputImage()
An image input to the model. Learn about image inputs
-
asInputFile
final ResponseInputFileContent asInputFile()
A file input to the model.
-
accept
final <T extends Any> T accept(ResponseFunctionCallOutputItem.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 = responseFunctionCallOutputItem.accept(new ResponseFunctionCallOutputItem.Visitor<Optional<String>>() { @Override public Optional<String> visitInputText(ResponseInputTextContent inputText) { return Optional.of(inputText.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResponseFunctionCallOutputItem 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.
-
ofInputText
final static ResponseFunctionCallOutputItem ofInputText(ResponseInputTextContent inputText)
A text input to the model.
-
ofInputImage
final static ResponseFunctionCallOutputItem ofInputImage(ResponseInputImageContent inputImage)
An image input to the model. Learn about image inputs
-
ofInputFile
final static ResponseFunctionCallOutputItem ofInputFile(ResponseInputFileContent inputFile)
A file input to the model.
-
-
-
-