Class BetaResponseFunctionToolCallOutputItem.Output
-
- All Implemented Interfaces:
public final class BetaResponseFunctionToolCallOutputItem.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 interfaceBetaResponseFunctionToolCallOutputItem.Output.VisitorAn interface that defines how to map each variant of Output to a value of type T.
public final classBetaResponseFunctionToolCallOutputItem.Output.BetaFunctionAndCustomToolCallOutputA 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<BetaResponseFunctionToolCallOutputItem.Output.BetaFunctionAndCustomToolCallOutput>>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<BetaResponseFunctionToolCallOutputItem.Output.BetaFunctionAndCustomToolCallOutput>asContentList()Text, image, or file output of the function call. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaResponseFunctionToolCallOutputItem.Output.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaResponseFunctionToolCallOutputItem.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 BetaResponseFunctionToolCallOutputItem.OutputofString(String string)A string of the output of the function call. final static BetaResponseFunctionToolCallOutputItem.OutputofContentList(List<BetaResponseFunctionToolCallOutputItem.Output.BetaFunctionAndCustomToolCallOutput> contentList)Text, image, or file output of the function call. -
-
Method Detail
-
contentList
final Optional<List<BetaResponseFunctionToolCallOutputItem.Output.BetaFunctionAndCustomToolCallOutput>> contentList()
Text, image, or file output of the function call.
-
isContentList
final Boolean isContentList()
-
asContentList
final List<BetaResponseFunctionToolCallOutputItem.Output.BetaFunctionAndCustomToolCallOutput> asContentList()
Text, image, or file output of the function call.
-
accept
final <T extends Any> T accept(BetaResponseFunctionToolCallOutputItem.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 BetaResponseFunctionToolCallOutputItem.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 BetaResponseFunctionToolCallOutputItem.Output ofString(String string)
A string of the output of the function call.
-
ofContentList
final static BetaResponseFunctionToolCallOutputItem.Output ofContentList(List<BetaResponseFunctionToolCallOutputItem.Output.BetaFunctionAndCustomToolCallOutput> contentList)
Text, image, or file output of the function call.
-
-
-
-