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