Class ResponseFunctionToolCallOutputItem.Output
-
- All Implemented Interfaces:
public final class ResponseFunctionToolCallOutputItem.OutputThe output from the function call generated by your code. Can be a string or an list of output content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseFunctionToolCallOutputItem.Output.VisitorAn interface that defines how to map each variant of Output to a value of type T.
public final classResponseFunctionToolCallOutputItem.Output.FunctionAndCustomToolCallOutputA text input to the model.
-
Method Summary
Modifier and Type Method Description final Optional<String>string()A string of the output of the function call. final Optional<List<ResponseFunctionToolCallOutputItem.Output.FunctionAndCustomToolCallOutput>>contentList()Text, image, or file output of the function call. final BooleanisString()final BooleanisContentList()final StringasString()A string of the output of the function call. final List<ResponseFunctionToolCallOutputItem.Output.FunctionAndCustomToolCallOutput>asContentList()Text, image, or file output of the function call. final Optional<JsonValue>_json()final <T extends Any> Taccept(ResponseFunctionToolCallOutputItem.Output.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ResponseFunctionToolCallOutputItem.Outputvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseFunctionToolCallOutputItem.OutputofString(String string)A string of the output of the function call. final static ResponseFunctionToolCallOutputItem.OutputofContentList(List<ResponseFunctionToolCallOutputItem.Output.FunctionAndCustomToolCallOutput> contentList)Text, image, or file output of the function call. -
-
Method Detail
-
contentList
final Optional<List<ResponseFunctionToolCallOutputItem.Output.FunctionAndCustomToolCallOutput>> contentList()
Text, image, or file output of the function call.
-
isContentList
final Boolean isContentList()
-
asContentList
final List<ResponseFunctionToolCallOutputItem.Output.FunctionAndCustomToolCallOutput> asContentList()
Text, image, or file output of the function call.
-
accept
final <T extends Any> T accept(ResponseFunctionToolCallOutputItem.Output.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 = output.accept(new Output.Visitor<Optional<String>>() { @Override public Optional<String> visitString(String string) { return Optional.of(string.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResponseFunctionToolCallOutputItem.Output 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.
-
ofString
final static ResponseFunctionToolCallOutputItem.Output ofString(String string)
A string of the output of the function call.
-
ofContentList
final static ResponseFunctionToolCallOutputItem.Output ofContentList(List<ResponseFunctionToolCallOutputItem.Output.FunctionAndCustomToolCallOutput> contentList)
Text, image, or file output of the function call.
-
-
-
-