Class CodeInterpreterToolCallDelta.CodeInterpreter.Output
-
- All Implemented Interfaces:
public final class CodeInterpreterToolCallDelta.CodeInterpreter.OutputText output from the Code Interpreter tool call as part of a run step.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCodeInterpreterToolCallDelta.CodeInterpreter.Output.VisitorAn interface that defines how to map each variant of Output to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<CodeInterpreterLogs>logs()Text output from the Code Interpreter tool call as part of a run step. final Optional<CodeInterpreterOutputImage>image()final BooleanisLogs()final BooleanisImage()final CodeInterpreterLogsasLogs()Text output from the Code Interpreter tool call as part of a run step. final CodeInterpreterOutputImageasImage()final Optional<JsonValue>_json()final <T extends Any> Taccept(CodeInterpreterToolCallDelta.CodeInterpreter.Output.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final CodeInterpreterToolCallDelta.CodeInterpreter.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 CodeInterpreterToolCallDelta.CodeInterpreter.OutputofLogs(CodeInterpreterLogs logs)Text output from the Code Interpreter tool call as part of a run step. final static CodeInterpreterToolCallDelta.CodeInterpreter.OutputofImage(CodeInterpreterOutputImage image)-
-
Method Detail
-
logs
final Optional<CodeInterpreterLogs> logs()
Text output from the Code Interpreter tool call as part of a run step.
-
image
final Optional<CodeInterpreterOutputImage> image()
-
asLogs
final CodeInterpreterLogs asLogs()
Text output from the Code Interpreter tool call as part of a run step.
-
asImage
final CodeInterpreterOutputImage asImage()
-
accept
final <T extends Any> T accept(CodeInterpreterToolCallDelta.CodeInterpreter.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> visitLogs(CodeInterpreterLogs logs) { return Optional.of(logs.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final CodeInterpreterToolCallDelta.CodeInterpreter.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.
-
ofLogs
final static CodeInterpreterToolCallDelta.CodeInterpreter.Output ofLogs(CodeInterpreterLogs logs)
Text output from the Code Interpreter tool call as part of a run step.
-
ofImage
final static CodeInterpreterToolCallDelta.CodeInterpreter.Output ofImage(CodeInterpreterOutputImage image)
-
-
-
-