Class BetaWebSearchToolResultBlock.Caller
-
- All Implemented Interfaces:
public final class BetaWebSearchToolResultBlock.CallerTool invocation directly from the model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaWebSearchToolResultBlock.Caller.VisitorAn interface that defines how to map each variant of Caller to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaDirectCaller>direct()Tool invocation directly from the model. final Optional<BetaServerToolCaller>codeExecution20250825()Tool invocation generated by a server-side tool. final Optional<BetaServerToolCaller20260120>codeExecution20260120()final BooleanisDirect()final BooleanisCodeExecution20250825()final BooleanisCodeExecution20260120()final BetaDirectCallerasDirect()Tool invocation directly from the model. final BetaServerToolCallerasCodeExecution20250825()Tool invocation generated by a server-side tool. final BetaServerToolCaller20260120asCodeExecution20260120()final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaWebSearchToolResultBlock.Caller.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaWebSearchToolResultBlock.Callervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaWebSearchToolResultBlock.CallerofDirect(BetaDirectCaller direct)Tool invocation directly from the model. final static BetaWebSearchToolResultBlock.CallerofCodeExecution20250825(BetaServerToolCaller codeExecution20250825)Tool invocation generated by a server-side tool. final static BetaWebSearchToolResultBlock.CallerofCodeExecution20260120(BetaServerToolCaller20260120 codeExecution20260120)-
-
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(BetaWebSearchToolResultBlock.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 BetaWebSearchToolResultBlock.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 BetaWebSearchToolResultBlock.Caller ofDirect(BetaDirectCaller direct)
Tool invocation directly from the model.
-
ofCodeExecution20250825
final static BetaWebSearchToolResultBlock.Caller ofCodeExecution20250825(BetaServerToolCaller codeExecution20250825)
Tool invocation generated by a server-side tool.
-
ofCodeExecution20260120
final static BetaWebSearchToolResultBlock.Caller ofCodeExecution20260120(BetaServerToolCaller20260120 codeExecution20260120)
-
-
-
-