Class BetaTool.CodeInterpreter.Container
-
- All Implemented Interfaces:
public final class BetaTool.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 interfaceBetaTool.CodeInterpreter.Container.VisitorAn interface that defines how to map each variant of Container to a value of type T.
public final classBetaTool.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<BetaTool.CodeInterpreter.Container.CodeInterpreterToolAuto>codeInterpreterToolAuto()Configuration for a code interpreter container. final BooleanisString()final BooleanisCodeInterpreterToolAuto()final StringasString()The container ID. final BetaTool.CodeInterpreter.Container.CodeInterpreterToolAutoasCodeInterpreterToolAuto()Configuration for a code interpreter container. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaTool.CodeInterpreter.Container.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaTool.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 BetaTool.CodeInterpreter.ContainerofString(String string)The container ID. final static BetaTool.CodeInterpreter.ContainerofCodeInterpreterToolAuto(BetaTool.CodeInterpreter.Container.CodeInterpreterToolAuto codeInterpreterToolAuto)Configuration for a code interpreter container. -
-
Method Detail
-
codeInterpreterToolAuto
final Optional<BetaTool.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 BetaTool.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(BetaTool.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 BetaTool.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 BetaTool.CodeInterpreter.Container ofString(String string)
The container ID.
-
ofCodeInterpreterToolAuto
final static BetaTool.CodeInterpreter.Container ofCodeInterpreterToolAuto(BetaTool.CodeInterpreter.Container.CodeInterpreterToolAuto codeInterpreterToolAuto)
Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
-
-
-