Class BetaThinkingConfigParam
-
- All Implemented Interfaces:
public final class BetaThinkingConfigParamConfiguration for enabling Claude's extended thinking.
When enabled, responses include
thinkingcontent blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards yourmax_tokenslimit.See extended thinking for details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaThinkingConfigParam.VisitorAn interface that defines how to map each variant of BetaThinkingConfigParam to a value of type T.
-
Method Summary
-
-
Method Detail
-
enabled
final Optional<BetaThinkingConfigEnabled> enabled()
-
disabled
final Optional<BetaThinkingConfigDisabled> disabled()
-
adaptive
final Optional<BetaThinkingConfigAdaptive> adaptive()
-
isDisabled
final Boolean isDisabled()
-
isAdaptive
final Boolean isAdaptive()
-
asEnabled
final BetaThinkingConfigEnabled asEnabled()
-
asDisabled
final BetaThinkingConfigDisabled asDisabled()
-
asAdaptive
final BetaThinkingConfigAdaptive asAdaptive()
-
accept
final <T extends Any> T accept(BetaThinkingConfigParam.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 = betaThinkingConfigParam.accept(new BetaThinkingConfigParam.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 BetaThinkingConfigParam 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 BetaThinkingConfigParam ofEnabled(BetaThinkingConfigEnabled enabled)
-
ofDisabled
final static BetaThinkingConfigParam ofDisabled(BetaThinkingConfigDisabled disabled)
-
ofAdaptive
final static BetaThinkingConfigParam ofAdaptive(BetaThinkingConfigAdaptive adaptive)
-
-
-
-