Class BetaFallbacksParam
-
- All Implemented Interfaces:
public final class BetaFallbacksParamOpt-in server-side retry on one or more substitute models when the requested model declines for policy reasons. Tried in order: if the first entry also declines, the second is tried, and so on. Some models don't support fallbacks; on those models, a list of fallback models returns a 400 error. See Server-side fallback. The string "default" requests the requested model's server-defined default fallback configuration. On a model that doesn't support fallbacks, the request runs on the requested model alone, so a declined request stays declined.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaFallbacksParam.VisitorAn interface that defines how to map each variant of BetaFallbacksParam to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<List<BetaFallbackParam>>fallbackParams()final Optional<JsonValue>default_()final Optional<JsonValue>_json()final BooleanisFallbackParams()final BooleanisDefault()final List<BetaFallbackParam>asFallbackParams()final JsonValueasDefault()final <T extends Any> Taccept(BetaFallbacksParam.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaFallbacksParamvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaFallbacksParamofFallbackParams(List<BetaFallbackParam> fallbackParams)final static BetaFallbacksParamofDefault()-
-
Method Detail
-
fallbackParams
final Optional<List<BetaFallbackParam>> fallbackParams()
-
isFallbackParams
final Boolean isFallbackParams()
-
asFallbackParams
final List<BetaFallbackParam> asFallbackParams()
-
accept
final <T extends Any> T accept(BetaFallbacksParam.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.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = betaFallbacksParam.accept(new BetaFallbacksParam.Visitor<Optional<String>>() { @Override public Optional<String> visitFallbackParams(List<BetaFallbackParam> fallbackParams) { return Optional.of(fallbackParams.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaFallbacksParam 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.
-
ofFallbackParams
final static BetaFallbacksParam ofFallbackParams(List<BetaFallbackParam> fallbackParams)
-
ofDefault
final static BetaFallbacksParam ofDefault()
-
-
-
-