Class Tool.CodeInterpreter.Container
-
- All Implemented Interfaces:
public final class Tool.CodeInterpreter.ContainerThe code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceTool.CodeInterpreter.Container.VisitorAn interface that defines how to map each variant of Container to a value of type T.
public final classTool.CodeInterpreter.Container.CodeInterpreterToolAutoConfiguration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
Method Summary
Modifier and Type Method Description final Optional<String>string()The container ID. final Optional<Tool.CodeInterpreter.Container.CodeInterpreterToolAuto>codeInterpreterToolAuto()Configuration for a code interpreter container. final BooleanisString()final BooleanisCodeInterpreterToolAuto()final StringasString()The container ID. final Tool.CodeInterpreter.Container.CodeInterpreterToolAutoasCodeInterpreterToolAuto()Configuration for a code interpreter container. final Optional<JsonValue>_json()final <T extends Any> Taccept(Tool.CodeInterpreter.Container.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final Tool.CodeInterpreter.Containervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Tool.CodeInterpreter.ContainerofString(String string)The container ID. final static Tool.CodeInterpreter.ContainerofCodeInterpreterToolAuto(Tool.CodeInterpreter.Container.CodeInterpreterToolAuto codeInterpreterToolAuto)Configuration for a code interpreter container. -
-
Method Detail
-
codeInterpreterToolAuto
final Optional<Tool.CodeInterpreter.Container.CodeInterpreterToolAuto> codeInterpreterToolAuto()
Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
isCodeInterpreterToolAuto
final Boolean isCodeInterpreterToolAuto()
-
asCodeInterpreterToolAuto
final Tool.CodeInterpreter.Container.CodeInterpreterToolAuto asCodeInterpreterToolAuto()
Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
accept
final <T extends Any> T accept(Tool.CodeInterpreter.Container.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 = container.accept(new Container.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 Tool.CodeInterpreter.Container 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 Tool.CodeInterpreter.Container ofString(String string)
The container ID.
-
ofCodeInterpreterToolAuto
final static Tool.CodeInterpreter.Container ofCodeInterpreterToolAuto(Tool.CodeInterpreter.Container.CodeInterpreterToolAuto codeInterpreterToolAuto)
Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
-
-
-