Class BetaToolUnion
-
- All Implemented Interfaces:
public final class BetaToolUnionCode execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaToolUnion.VisitorAn interface that defines how to map each variant of BetaToolUnion to a value of type T.
-
Method Summary
-
-
Method Detail
-
bash20241022
final Optional<BetaToolBash20241022> bash20241022()
-
bash20250124
final Optional<BetaToolBash20250124> bash20250124()
-
codeExecutionTool20250522
final Optional<BetaCodeExecutionTool20250522> codeExecutionTool20250522()
-
codeExecutionTool20250825
final Optional<BetaCodeExecutionTool20250825> codeExecutionTool20250825()
-
codeExecutionTool20260120
final Optional<BetaCodeExecutionTool20260120> codeExecutionTool20260120()
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
computerUse20241022
final Optional<BetaToolComputerUse20241022> computerUse20241022()
-
memoryTool20250818
final Optional<BetaMemoryTool20250818> memoryTool20250818()
-
computerUse20250124
final Optional<BetaToolComputerUse20250124> computerUse20250124()
-
textEditor20241022
final Optional<BetaToolTextEditor20241022> textEditor20241022()
-
computerUse20251124
final Optional<BetaToolComputerUse20251124> computerUse20251124()
-
textEditor20250124
final Optional<BetaToolTextEditor20250124> textEditor20250124()
-
textEditor20250429
final Optional<BetaToolTextEditor20250429> textEditor20250429()
-
textEditor20250728
final Optional<BetaToolTextEditor20250728> textEditor20250728()
-
webSearchTool20250305
final Optional<BetaWebSearchTool20250305> webSearchTool20250305()
-
webFetchTool20250910
final Optional<BetaWebFetchTool20250910> webFetchTool20250910()
-
webSearchTool20260209
final Optional<BetaWebSearchTool20260209> webSearchTool20260209()
-
webFetchTool20260209
final Optional<BetaWebFetchTool20260209> webFetchTool20260209()
-
webFetchTool20260309
final Optional<BetaWebFetchTool20260309> webFetchTool20260309()
Web fetch tool with use_cache parameter for bypassing cached content.
-
advisorTool20260301
final Optional<BetaAdvisorTool20260301> advisorTool20260301()
-
searchToolBm25_20251119
final Optional<BetaToolSearchToolBm25_20251119> searchToolBm25_20251119()
-
searchToolRegex20251119
final Optional<BetaToolSearchToolRegex20251119> searchToolRegex20251119()
-
mcpToolset
final Optional<BetaMcpToolset> mcpToolset()
Configuration for a group of tools from an MCP server.
Allows configuring enabled status and defer_loading for all tools from an MCP server, with optional per-tool overrides.
-
isBetaTool
final Boolean isBetaTool()
-
isBash20241022
final Boolean isBash20241022()
-
isBash20250124
final Boolean isBash20250124()
-
isCodeExecutionTool20250522
final Boolean isCodeExecutionTool20250522()
-
isCodeExecutionTool20250825
final Boolean isCodeExecutionTool20250825()
-
isCodeExecutionTool20260120
final Boolean isCodeExecutionTool20260120()
-
isComputerUse20241022
final Boolean isComputerUse20241022()
-
isMemoryTool20250818
final Boolean isMemoryTool20250818()
-
isComputerUse20250124
final Boolean isComputerUse20250124()
-
isTextEditor20241022
final Boolean isTextEditor20241022()
-
isComputerUse20251124
final Boolean isComputerUse20251124()
-
isTextEditor20250124
final Boolean isTextEditor20250124()
-
isTextEditor20250429
final Boolean isTextEditor20250429()
-
isTextEditor20250728
final Boolean isTextEditor20250728()
-
isWebSearchTool20250305
final Boolean isWebSearchTool20250305()
-
isWebFetchTool20250910
final Boolean isWebFetchTool20250910()
-
isWebSearchTool20260209
final Boolean isWebSearchTool20260209()
-
isWebFetchTool20260209
final Boolean isWebFetchTool20260209()
-
isWebFetchTool20260309
final Boolean isWebFetchTool20260309()
-
isAdvisorTool20260301
final Boolean isAdvisorTool20260301()
-
isSearchToolBm25_20251119
final Boolean isSearchToolBm25_20251119()
-
isSearchToolRegex20251119
final Boolean isSearchToolRegex20251119()
-
isMcpToolset
final Boolean isMcpToolset()
-
asBetaTool
final BetaTool asBetaTool()
-
asBash20241022
final BetaToolBash20241022 asBash20241022()
-
asBash20250124
final BetaToolBash20250124 asBash20250124()
-
asCodeExecutionTool20250522
final BetaCodeExecutionTool20250522 asCodeExecutionTool20250522()
-
asCodeExecutionTool20250825
final BetaCodeExecutionTool20250825 asCodeExecutionTool20250825()
-
asCodeExecutionTool20260120
final BetaCodeExecutionTool20260120 asCodeExecutionTool20260120()
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
asComputerUse20241022
final BetaToolComputerUse20241022 asComputerUse20241022()
-
asMemoryTool20250818
final BetaMemoryTool20250818 asMemoryTool20250818()
-
asComputerUse20250124
final BetaToolComputerUse20250124 asComputerUse20250124()
-
asTextEditor20241022
final BetaToolTextEditor20241022 asTextEditor20241022()
-
asComputerUse20251124
final BetaToolComputerUse20251124 asComputerUse20251124()
-
asTextEditor20250124
final BetaToolTextEditor20250124 asTextEditor20250124()
-
asTextEditor20250429
final BetaToolTextEditor20250429 asTextEditor20250429()
-
asTextEditor20250728
final BetaToolTextEditor20250728 asTextEditor20250728()
-
asWebSearchTool20250305
final BetaWebSearchTool20250305 asWebSearchTool20250305()
-
asWebFetchTool20250910
final BetaWebFetchTool20250910 asWebFetchTool20250910()
-
asWebSearchTool20260209
final BetaWebSearchTool20260209 asWebSearchTool20260209()
-
asWebFetchTool20260209
final BetaWebFetchTool20260209 asWebFetchTool20260209()
-
asWebFetchTool20260309
final BetaWebFetchTool20260309 asWebFetchTool20260309()
Web fetch tool with use_cache parameter for bypassing cached content.
-
asAdvisorTool20260301
final BetaAdvisorTool20260301 asAdvisorTool20260301()
-
asSearchToolBm25_20251119
final BetaToolSearchToolBm25_20251119 asSearchToolBm25_20251119()
-
asSearchToolRegex20251119
final BetaToolSearchToolRegex20251119 asSearchToolRegex20251119()
-
asMcpToolset
final BetaMcpToolset asMcpToolset()
Configuration for a group of tools from an MCP server.
Allows configuring enabled status and defer_loading for all tools from an MCP server, with optional per-tool overrides.
-
accept
final <T extends Any> T accept(BetaToolUnion.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 = betaToolUnion.accept(new BetaToolUnion.Visitor<Optional<String>>() { @Override public Optional<String> visitBetaTool(BetaTool betaTool) { return Optional.of(betaTool.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaToolUnion 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.
-
ofBetaTool
final static BetaToolUnion ofBetaTool(BetaTool betaTool)
-
ofBash20241022
final static BetaToolUnion ofBash20241022(BetaToolBash20241022 bash20241022)
-
ofBash20250124
final static BetaToolUnion ofBash20250124(BetaToolBash20250124 bash20250124)
-
ofCodeExecutionTool20250522
final static BetaToolUnion ofCodeExecutionTool20250522(BetaCodeExecutionTool20250522 codeExecutionTool20250522)
-
ofCodeExecutionTool20250825
final static BetaToolUnion ofCodeExecutionTool20250825(BetaCodeExecutionTool20250825 codeExecutionTool20250825)
-
ofCodeExecutionTool20260120
final static BetaToolUnion ofCodeExecutionTool20260120(BetaCodeExecutionTool20260120 codeExecutionTool20260120)
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
ofComputerUse20241022
final static BetaToolUnion ofComputerUse20241022(BetaToolComputerUse20241022 computerUse20241022)
-
ofMemoryTool20250818
final static BetaToolUnion ofMemoryTool20250818(BetaMemoryTool20250818 memoryTool20250818)
-
ofComputerUse20250124
final static BetaToolUnion ofComputerUse20250124(BetaToolComputerUse20250124 computerUse20250124)
-
ofTextEditor20241022
final static BetaToolUnion ofTextEditor20241022(BetaToolTextEditor20241022 textEditor20241022)
-
ofComputerUse20251124
final static BetaToolUnion ofComputerUse20251124(BetaToolComputerUse20251124 computerUse20251124)
-
ofTextEditor20250124
final static BetaToolUnion ofTextEditor20250124(BetaToolTextEditor20250124 textEditor20250124)
-
ofTextEditor20250429
final static BetaToolUnion ofTextEditor20250429(BetaToolTextEditor20250429 textEditor20250429)
-
ofTextEditor20250728
final static BetaToolUnion ofTextEditor20250728(BetaToolTextEditor20250728 textEditor20250728)
-
ofWebSearchTool20250305
final static BetaToolUnion ofWebSearchTool20250305(BetaWebSearchTool20250305 webSearchTool20250305)
-
ofWebFetchTool20250910
final static BetaToolUnion ofWebFetchTool20250910(BetaWebFetchTool20250910 webFetchTool20250910)
-
ofWebSearchTool20260209
final static BetaToolUnion ofWebSearchTool20260209(BetaWebSearchTool20260209 webSearchTool20260209)
-
ofWebFetchTool20260209
final static BetaToolUnion ofWebFetchTool20260209(BetaWebFetchTool20260209 webFetchTool20260209)
-
ofWebFetchTool20260309
final static BetaToolUnion ofWebFetchTool20260309(BetaWebFetchTool20260309 webFetchTool20260309)
Web fetch tool with use_cache parameter for bypassing cached content.
-
ofAdvisorTool20260301
final static BetaToolUnion ofAdvisorTool20260301(BetaAdvisorTool20260301 advisorTool20260301)
-
ofSearchToolBm25_20251119
final static BetaToolUnion ofSearchToolBm25_20251119(BetaToolSearchToolBm25_20251119 searchToolBm25_20251119)
-
ofSearchToolRegex20251119
final static BetaToolUnion ofSearchToolRegex20251119(BetaToolSearchToolRegex20251119 searchToolRegex20251119)
-
ofMcpToolset
final static BetaToolUnion ofMcpToolset(BetaMcpToolset mcpToolset)
Configuration for a group of tools from an MCP server.
Allows configuring enabled status and defer_loading for all tools from an MCP server, with optional per-tool overrides.
-
-
-
-