Class BetaContextManagementConfig.Edit
-
- All Implemented Interfaces:
public final class BetaContextManagementConfig.EditAutomatically compact older context when reaching the configured trigger threshold.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaContextManagementConfig.Edit.VisitorAn interface that defines how to map each variant of Edit to a value of type T.
-
Method Summary
-
-
Method Detail
-
clearToolUses20250919
final Optional<BetaClearToolUses20250919Edit> clearToolUses20250919()
-
clearThinking20251015
final Optional<BetaClearThinking20251015Edit> clearThinking20251015()
-
compact20260112
final Optional<BetaCompact20260112Edit> compact20260112()
Automatically compact older context when reaching the configured trigger threshold.
-
isClearToolUses20250919
final Boolean isClearToolUses20250919()
-
isClearThinking20251015
final Boolean isClearThinking20251015()
-
isCompact20260112
final Boolean isCompact20260112()
-
asClearToolUses20250919
final BetaClearToolUses20250919Edit asClearToolUses20250919()
-
asClearThinking20251015
final BetaClearThinking20251015Edit asClearThinking20251015()
-
asCompact20260112
final BetaCompact20260112Edit asCompact20260112()
Automatically compact older context when reaching the configured trigger threshold.
-
accept
final <T extends Any> T accept(BetaContextManagementConfig.Edit.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 = edit.accept(new Edit.Visitor<Optional<String>>() { @Override public Optional<String> visitClearToolUses20250919(BetaClearToolUses20250919Edit clearToolUses20250919) { return Optional.of(clearToolUses20250919.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaContextManagementConfig.Edit 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.
-
ofClearToolUses20250919
final static BetaContextManagementConfig.Edit ofClearToolUses20250919(BetaClearToolUses20250919Edit clearToolUses20250919)
-
ofClearThinking20251015
final static BetaContextManagementConfig.Edit ofClearThinking20251015(BetaClearThinking20251015Edit clearThinking20251015)
-
ofCompact20260112
final static BetaContextManagementConfig.Edit ofCompact20260112(BetaCompact20260112Edit compact20260112)
Automatically compact older context when reaching the configured trigger threshold.
-
-
-
-