Class BetaWebSearchToolResultBlockParam.Caller
-
- All Implemented Interfaces:
public final class BetaWebSearchToolResultBlockParam.CallerTool invocation directly from the model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaWebSearchToolResultBlockParam.Caller.VisitorAn interface that defines how to map each variant of Caller to a value of type T.
-
Method Summary
-
-
Method Detail
-
direct
final Optional<BetaDirectCaller> direct()
Tool invocation directly from the model.
-
codeExecution20250825
final Optional<BetaServerToolCaller> codeExecution20250825()
Tool invocation generated by a server-side tool.
-
codeExecution20260120
final Optional<BetaServerToolCaller20260120> codeExecution20260120()
-
isCodeExecution20250825
final Boolean isCodeExecution20250825()
-
isCodeExecution20260120
final Boolean isCodeExecution20260120()
-
asDirect
final BetaDirectCaller asDirect()
Tool invocation directly from the model.
-
asCodeExecution20250825
final BetaServerToolCaller asCodeExecution20250825()
Tool invocation generated by a server-side tool.
-
asCodeExecution20260120
final BetaServerToolCaller20260120 asCodeExecution20260120()
-
accept
final <T extends Any> T accept(BetaWebSearchToolResultBlockParam.Caller.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 = caller.accept(new Caller.Visitor<Optional<String>>() { @Override public Optional<String> visitDirect(BetaDirectCaller direct) { return Optional.of(direct.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaWebSearchToolResultBlockParam.Caller 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.
-
ofDirect
final static BetaWebSearchToolResultBlockParam.Caller ofDirect(BetaDirectCaller direct)
Tool invocation directly from the model.
-
ofCodeExecution20250825
final static BetaWebSearchToolResultBlockParam.Caller ofCodeExecution20250825(BetaServerToolCaller codeExecution20250825)
Tool invocation generated by a server-side tool.
-
ofCodeExecution20260120
final static BetaWebSearchToolResultBlockParam.Caller ofCodeExecution20260120(BetaServerToolCaller20260120 codeExecution20260120)
-
-
-
-