Class ResponseCodeInterpreterToolCall.Output
-
- All Implemented Interfaces:
public final class ResponseCodeInterpreterToolCall.OutputThe logs output from the code interpreter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseCodeInterpreterToolCall.Output.VisitorAn interface that defines how to map each variant of Output to a value of type T.
public final classResponseCodeInterpreterToolCall.Output.LogsThe logs output from the code interpreter.
public final classResponseCodeInterpreterToolCall.Output.ImageThe image output from the code interpreter.
-
Method Summary
Modifier and Type Method Description final Optional<ResponseCodeInterpreterToolCall.Output.Logs>logs()The logs output from the code interpreter. final Optional<ResponseCodeInterpreterToolCall.Output.Image>image()The image output from the code interpreter. final BooleanisLogs()final BooleanisImage()final ResponseCodeInterpreterToolCall.Output.LogsasLogs()The logs output from the code interpreter. final ResponseCodeInterpreterToolCall.Output.ImageasImage()The image output from the code interpreter. final Optional<JsonValue>_json()final <T extends Any> Taccept(ResponseCodeInterpreterToolCall.Output.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ResponseCodeInterpreterToolCall.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 ResponseCodeInterpreterToolCall.OutputofLogs(ResponseCodeInterpreterToolCall.Output.Logs logs)The logs output from the code interpreter. final static ResponseCodeInterpreterToolCall.OutputofImage(ResponseCodeInterpreterToolCall.Output.Image image)The image output from the code interpreter. -
-
Method Detail
-
logs
final Optional<ResponseCodeInterpreterToolCall.Output.Logs> logs()
The logs output from the code interpreter.
-
image
final Optional<ResponseCodeInterpreterToolCall.Output.Image> image()
The image output from the code interpreter.
-
asLogs
final ResponseCodeInterpreterToolCall.Output.Logs asLogs()
The logs output from the code interpreter.
-
asImage
final ResponseCodeInterpreterToolCall.Output.Image asImage()
The image output from the code interpreter.
-
accept
final <T extends Any> T accept(ResponseCodeInterpreterToolCall.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(Logs logs) { return Optional.of(logs.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResponseCodeInterpreterToolCall.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 ResponseCodeInterpreterToolCall.Output ofLogs(ResponseCodeInterpreterToolCall.Output.Logs logs)
The logs output from the code interpreter.
-
ofImage
final static ResponseCodeInterpreterToolCall.Output ofImage(ResponseCodeInterpreterToolCall.Output.Image image)
The image output from the code interpreter.
-
-
-
-