Class BetaFallbackParam.Thinking
-
- All Implemented Interfaces:
public final class BetaFallbackParam.ThinkingThe thinking configuration for the fallback attempt that uses this
fallbacksentry'smodel. If you leave it out, the attempt uses the request'sthinkingwhenmodelsupports that thinkingtype.If you leave it out and the request's thinking
typeisbetween_toolsbutmodeldoesn't supportbetween_tools, the attempt usesdisabledifmodelsupports it. Otherwise, ifmodeldoesn't support the request's thinkingtype, if the request doesn't setthinking, or if you set this field tonull, the attempt uses the thinkingtypethatmodeluses when a request leaves outthinking. The request'sthinking.displaystill applies wheremodelallows it.These rules apply with the
server-side-fallback-2026-07-01beta header.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaFallbackParam.Thinking.VisitorAn interface that defines how to map each variant of Thinking to a value of type T.
public final classBetaFallbackParam.Thinking.Type
-
Method Summary
-
-
Method Detail
-
enabled
final Optional<BetaThinkingConfigEnabled> enabled()
-
disabled
final Optional<BetaThinkingConfigDisabled> disabled()
-
betweenTools
final Optional<BetaThinkingConfigBetweenTools> betweenTools()
-
adaptive
final Optional<BetaThinkingConfigAdaptive> adaptive()
-
type
final BetaFallbackParam.Thinking.Type type()
-
blockBinding
final Optional<BetaThinkingBlockBinding> blockBinding()
-
isDisabled
final Boolean isDisabled()
-
isBetweenTools
final Boolean isBetweenTools()
-
isAdaptive
final Boolean isAdaptive()
-
asEnabled
final BetaThinkingConfigEnabled asEnabled()
-
asDisabled
final BetaThinkingConfigDisabled asDisabled()
-
asBetweenTools
final BetaThinkingConfigBetweenTools asBetweenTools()
-
asAdaptive
final BetaThinkingConfigAdaptive asAdaptive()
-
accept
final <T extends Any> T accept(BetaFallbackParam.Thinking.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 = thinking.accept(new Thinking.Visitor<Optional<String>>() { @Override public Optional<String> visitEnabled(BetaThinkingConfigEnabled enabled) { return Optional.of(enabled.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaFallbackParam.Thinking 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.
-
ofEnabled
final static BetaFallbackParam.Thinking ofEnabled(BetaThinkingConfigEnabled enabled)
-
ofEnabled
final static BetaFallbackParam.Thinking ofEnabled(Long budgetTokens)
Returns an immutable instance of Thinking whose ofEnabled variant is built from the given required budgetTokens.
-
ofDisabled
final static BetaFallbackParam.Thinking ofDisabled(BetaThinkingConfigDisabled disabled)
-
ofBetweenTools
final static BetaFallbackParam.Thinking ofBetweenTools(BetaThinkingConfigBetweenTools betweenTools)
-
ofAdaptive
final static BetaFallbackParam.Thinking ofAdaptive(BetaThinkingConfigAdaptive adaptive)
-
-
-
-