Class BetaClearThinking20251015Edit.Keep
-
- All Implemented Interfaces:
public final class BetaClearThinking20251015Edit.KeepNumber of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaClearThinking20251015Edit.Keep.VisitorAn interface that defines how to map each variant of Keep to a value of type T.
-
Method Summary
-
-
Method Detail
-
betaThinkingTurns
final Optional<BetaThinkingTurns> betaThinkingTurns()
-
betaAllThinkingTurns
final Optional<BetaAllThinkingTurns> betaAllThinkingTurns()
-
isBetaThinkingTurns
final Boolean isBetaThinkingTurns()
-
isBetaAllThinkingTurns
final Boolean isBetaAllThinkingTurns()
-
asBetaThinkingTurns
final BetaThinkingTurns asBetaThinkingTurns()
-
asBetaAllThinkingTurns
final BetaAllThinkingTurns asBetaAllThinkingTurns()
-
accept
final <T extends Any> T accept(BetaClearThinking20251015Edit.Keep.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 = keep.accept(new Keep.Visitor<Optional<String>>() { @Override public Optional<String> visitBetaThinkingTurns(BetaThinkingTurns betaThinkingTurns) { return Optional.of(betaThinkingTurns.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaClearThinking20251015Edit.Keep 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.
-
ofBetaThinkingTurns
final static BetaClearThinking20251015Edit.Keep ofBetaThinkingTurns(BetaThinkingTurns betaThinkingTurns)
-
ofBetaAllThinkingTurns
final static BetaClearThinking20251015Edit.Keep ofBetaAllThinkingTurns(BetaAllThinkingTurns betaAllThinkingTurns)
-
ofAll
final static BetaClearThinking20251015Edit.Keep ofAll()
-
-
-
-