Class BetaResponseFunctionShellToolCallOutput.Output.Outcome
-
- All Implemented Interfaces:
public final class BetaResponseFunctionShellToolCallOutput.Output.OutcomeRepresents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaResponseFunctionShellToolCallOutput.Output.Outcome.VisitorAn interface that defines how to map each variant of Outcome to a value of type T.
public final classBetaResponseFunctionShellToolCallOutput.Output.Outcome.ExitIndicates that the shell commands finished and returned an exit code.
-
Method Summary
Modifier and Type Method Description final Optional<JsonValue>timeout()Indicates that the shell call exceeded its configured time limit. final Optional<BetaResponseFunctionShellToolCallOutput.Output.Outcome.Exit>exit()Indicates that the shell commands finished and returned an exit code. final BooleanisTimeout()final BooleanisExit()final JsonValueasTimeout()Indicates that the shell call exceeded its configured time limit. final BetaResponseFunctionShellToolCallOutput.Output.Outcome.ExitasExit()Indicates that the shell commands finished and returned an exit code. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaResponseFunctionShellToolCallOutput.Output.Outcome.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaResponseFunctionShellToolCallOutput.Output.Outcomevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaResponseFunctionShellToolCallOutput.Output.OutcomeofTimeout()Indicates that the shell call exceeded its configured time limit. final static BetaResponseFunctionShellToolCallOutput.Output.OutcomeofExit(BetaResponseFunctionShellToolCallOutput.Output.Outcome.Exit exit)Indicates that the shell commands finished and returned an exit code. -
-
Method Detail
-
timeout
final Optional<JsonValue> timeout()
Indicates that the shell call exceeded its configured time limit.
-
exit
final Optional<BetaResponseFunctionShellToolCallOutput.Output.Outcome.Exit> exit()
Indicates that the shell commands finished and returned an exit code.
-
asTimeout
final JsonValue asTimeout()
Indicates that the shell call exceeded its configured time limit.
-
asExit
final BetaResponseFunctionShellToolCallOutput.Output.Outcome.Exit asExit()
Indicates that the shell commands finished and returned an exit code.
-
accept
final <T extends Any> T accept(BetaResponseFunctionShellToolCallOutput.Output.Outcome.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 = outcome.accept(new Outcome.Visitor<Optional<String>>() { @Override public Optional<String> visitTimeout(JsonValue timeout) { return Optional.of(timeout.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaResponseFunctionShellToolCallOutput.Output.Outcome 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.
-
ofTimeout
final static BetaResponseFunctionShellToolCallOutput.Output.Outcome ofTimeout()
Indicates that the shell call exceeded its configured time limit.
-
ofExit
final static BetaResponseFunctionShellToolCallOutput.Output.Outcome ofExit(BetaResponseFunctionShellToolCallOutput.Output.Outcome.Exit exit)
Indicates that the shell commands finished and returned an exit code.
-
-
-
-