Class CodeInterpreterToolCall.CodeInterpreter.Output
-
- All Implemented Interfaces:
public final class CodeInterpreterToolCall.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 interfaceCodeInterpreterToolCall.CodeInterpreter.Output.VisitorAn interface that defines how to map each variant of Output to a value of type T.
public final classCodeInterpreterToolCall.CodeInterpreter.Output.LogsOutputText output from the Code Interpreter tool call as part of a run step.
public final classCodeInterpreterToolCall.CodeInterpreter.Output.ImageOutput
-
Method Summary
-
-
Method Detail
-
logs
final Optional<CodeInterpreterToolCall.CodeInterpreter.Output.LogsOutput> logs()
Text output from the Code Interpreter tool call as part of a run step.
-
asLogs
final CodeInterpreterToolCall.CodeInterpreter.Output.LogsOutput asLogs()
Text output from the Code Interpreter tool call as part of a run step.
-
asImage
final CodeInterpreterToolCall.CodeInterpreter.Output.ImageOutput asImage()
-
accept
final <T extends Any> T accept(CodeInterpreterToolCall.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(LogsOutput logs) { return Optional.of(logs.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final CodeInterpreterToolCall.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 CodeInterpreterToolCall.CodeInterpreter.Output ofLogs(CodeInterpreterToolCall.CodeInterpreter.Output.LogsOutput logs)
Text output from the Code Interpreter tool call as part of a run step.
-
ofImage
final static CodeInterpreterToolCall.CodeInterpreter.Output ofImage(CodeInterpreterToolCall.CodeInterpreter.Output.ImageOutput image)
-
-
-
-