Class ResponseFunctionShellToolCall.Environment
-
- All Implemented Interfaces:
public final class ResponseFunctionShellToolCall.EnvironmentRepresents the use of a local environment to perform shell actions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseFunctionShellToolCall.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<ResponseLocalEnvironment>local()Represents the use of a local environment to perform shell actions. final Optional<ResponseContainerReference>containerReference()Represents a container created with /v1/containers. final BooleanisLocal()final BooleanisContainerReference()final ResponseLocalEnvironmentasLocal()Represents the use of a local environment to perform shell actions. final ResponseContainerReferenceasContainerReference()Represents a container created with /v1/containers. final Optional<JsonValue>_json()final <T extends Any> Taccept(ResponseFunctionShellToolCall.Environment.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ResponseFunctionShellToolCall.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 ResponseFunctionShellToolCall.EnvironmentofLocal(ResponseLocalEnvironment local)Represents the use of a local environment to perform shell actions. final static ResponseFunctionShellToolCall.EnvironmentofContainerReference(ResponseContainerReference containerReference)Represents a container created with /v1/containers. -
-
Method Detail
-
local
final Optional<ResponseLocalEnvironment> local()
Represents the use of a local environment to perform shell actions.
-
containerReference
final Optional<ResponseContainerReference> containerReference()
Represents a container created with /v1/containers.
-
isContainerReference
final Boolean isContainerReference()
-
asLocal
final ResponseLocalEnvironment asLocal()
Represents the use of a local environment to perform shell actions.
-
asContainerReference
final ResponseContainerReference asContainerReference()
Represents a container created with /v1/containers.
-
accept
final <T extends Any> T accept(ResponseFunctionShellToolCall.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(ResponseLocalEnvironment local) { return Optional.of(local.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResponseFunctionShellToolCall.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 ResponseFunctionShellToolCall.Environment ofLocal(ResponseLocalEnvironment local)
Represents the use of a local environment to perform shell actions.
-
ofContainerReference
final static ResponseFunctionShellToolCall.Environment ofContainerReference(ResponseContainerReference containerReference)
Represents a container created with /v1/containers.
-
-
-
-