Class BetaInputTransformation
-
- All Implemented Interfaces:
public final class BetaInputTransformationOne entry of
input_transformations: either a change the API made to the request's input before showing it to the model, or a block that failed a binding check and was still shown to the model unchanged. Thetypefield says which.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaInputTransformation.VisitorAn interface that defines how to map each variant of BetaInputTransformation to a value of type T.
public final classBetaInputTransformation.Type
-
Method Summary
-
-
Method Detail
-
thinkingDropped
final Optional<BetaThinkingDroppedInputTransformation> thinkingDropped()
-
thinkingMismatchAllowed
final Optional<BetaThinkingMismatchAllowedInputTransformation> thinkingMismatchAllowed()
-
type
final BetaInputTransformation.Type type()
-
isThinkingDropped
final Boolean isThinkingDropped()
-
isThinkingMismatchAllowed
final Boolean isThinkingMismatchAllowed()
-
asThinkingDropped
final BetaThinkingDroppedInputTransformation asThinkingDropped()
-
asThinkingMismatchAllowed
final BetaThinkingMismatchAllowedInputTransformation asThinkingMismatchAllowed()
-
accept
final <T extends Any> T accept(BetaInputTransformation.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 = betaInputTransformation.accept(new BetaInputTransformation.Visitor<Optional<String>>() { @Override public Optional<String> visitThinkingDropped(BetaThinkingDroppedInputTransformation thinkingDropped) { return Optional.of(thinkingDropped.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaInputTransformation 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.
-
ofThinkingDropped
final static BetaInputTransformation ofThinkingDropped(BetaThinkingDroppedInputTransformation thinkingDropped)
-
ofThinkingMismatchAllowed
final static BetaInputTransformation ofThinkingMismatchAllowed(BetaThinkingMismatchAllowedInputTransformation thinkingMismatchAllowed)
-
-
-
-