Class BetaResponseFunctionShellToolCall.Environment
-
- All Implemented Interfaces:
public final class BetaResponseFunctionShellToolCall.EnvironmentRepresents the use of a local environment to perform shell actions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaResponseFunctionShellToolCall.Environment.VisitorAn interface that defines how to map each variant of Environment to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaResponseLocalEnvironment>local()Represents the use of a local environment to perform shell actions. final Optional<BetaResponseContainerReference>containerReference()Represents a container created with /v1/containers. final BooleanisLocal()final BooleanisContainerReference()final BetaResponseLocalEnvironmentasLocal()Represents the use of a local environment to perform shell actions. final BetaResponseContainerReferenceasContainerReference()Represents a container created with /v1/containers. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaResponseFunctionShellToolCall.Environment.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaResponseFunctionShellToolCall.Environmentvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaResponseFunctionShellToolCall.EnvironmentofLocal(BetaResponseLocalEnvironment local)Represents the use of a local environment to perform shell actions. final static BetaResponseFunctionShellToolCall.EnvironmentofContainerReference(BetaResponseContainerReference containerReference)Represents a container created with /v1/containers. -
-
Method Detail
-
local
final Optional<BetaResponseLocalEnvironment> local()
Represents the use of a local environment to perform shell actions.
-
containerReference
final Optional<BetaResponseContainerReference> containerReference()
Represents a container created with /v1/containers.
-
isContainerReference
final Boolean isContainerReference()
-
asLocal
final BetaResponseLocalEnvironment asLocal()
Represents the use of a local environment to perform shell actions.
-
asContainerReference
final BetaResponseContainerReference asContainerReference()
Represents a container created with /v1/containers.
-
accept
final <T extends Any> T accept(BetaResponseFunctionShellToolCall.Environment.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 = environment.accept(new Environment.Visitor<Optional<String>>() { @Override public Optional<String> visitLocal(BetaResponseLocalEnvironment local) { return Optional.of(local.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaResponseFunctionShellToolCall.Environment 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.
-
ofLocal
final static BetaResponseFunctionShellToolCall.Environment ofLocal(BetaResponseLocalEnvironment local)
Represents the use of a local environment to perform shell actions.
-
ofContainerReference
final static BetaResponseFunctionShellToolCall.Environment ofContainerReference(BetaResponseContainerReference containerReference)
Represents a container created with /v1/containers.
-
-
-
-