Class ToolCallDelta
-
- All Implemented Interfaces:
public final class ToolCallDeltaDetails of the Code Interpreter tool call the run step was involved in.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceToolCallDelta.VisitorAn interface that defines how to map each variant of ToolCallDelta to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<CodeInterpreterToolCallDelta>codeInterpreter()Details of the Code Interpreter tool call the run step was involved in. final Optional<FileSearchToolCallDelta>fileSearch()final Optional<FunctionToolCallDelta>function()final BooleanisCodeInterpreter()final BooleanisFileSearch()final BooleanisFunction()final CodeInterpreterToolCallDeltaasCodeInterpreter()Details of the Code Interpreter tool call the run step was involved in. final FileSearchToolCallDeltaasFileSearch()final FunctionToolCallDeltaasFunction()final Optional<JsonValue>_json()final <T extends Any> Taccept(ToolCallDelta.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ToolCallDeltavalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ToolCallDeltaofCodeInterpreter(CodeInterpreterToolCallDelta codeInterpreter)Details of the Code Interpreter tool call the run step was involved in. final static ToolCallDeltaofFileSearch(FileSearchToolCallDelta fileSearch)final static ToolCallDeltaofFunction(FunctionToolCallDelta function)-
-
Method Detail
-
codeInterpreter
final Optional<CodeInterpreterToolCallDelta> codeInterpreter()
Details of the Code Interpreter tool call the run step was involved in.
-
fileSearch
final Optional<FileSearchToolCallDelta> fileSearch()
-
function
final Optional<FunctionToolCallDelta> function()
-
isCodeInterpreter
final Boolean isCodeInterpreter()
-
isFileSearch
final Boolean isFileSearch()
-
isFunction
final Boolean isFunction()
-
asCodeInterpreter
final CodeInterpreterToolCallDelta asCodeInterpreter()
Details of the Code Interpreter tool call the run step was involved in.
-
asFileSearch
final FileSearchToolCallDelta asFileSearch()
-
asFunction
final FunctionToolCallDelta asFunction()
-
accept
final <T extends Any> T accept(ToolCallDelta.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 = toolCallDelta.accept(new ToolCallDelta.Visitor<Optional<String>>() { @Override public Optional<String> visitCodeInterpreter(CodeInterpreterToolCallDelta codeInterpreter) { return Optional.of(codeInterpreter.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ToolCallDelta 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.
-
ofCodeInterpreter
final static ToolCallDelta ofCodeInterpreter(CodeInterpreterToolCallDelta codeInterpreter)
Details of the Code Interpreter tool call the run step was involved in.
-
ofFileSearch
final static ToolCallDelta ofFileSearch(FileSearchToolCallDelta fileSearch)
-
ofFunction
final static ToolCallDelta ofFunction(FunctionToolCallDelta function)
-
-
-
-