Class MessageCountTokensTool
-
- All Implemented Interfaces:
public final class MessageCountTokensToolCode execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMessageCountTokensTool.VisitorAn interface that defines how to map each variant of MessageCountTokensTool to a value of type T.
-
Method Summary
-
-
Method Detail
-
toolBash20250124
final Optional<ToolBash20250124> toolBash20250124()
-
codeExecutionTool20250522
final Optional<CodeExecutionTool20250522> codeExecutionTool20250522()
-
codeExecutionTool20250825
final Optional<CodeExecutionTool20250825> codeExecutionTool20250825()
-
codeExecutionTool20260120
final Optional<CodeExecutionTool20260120> codeExecutionTool20260120()
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
memoryTool20250818
final Optional<MemoryTool20250818> memoryTool20250818()
-
toolTextEditor20250124
final Optional<ToolTextEditor20250124> toolTextEditor20250124()
-
toolTextEditor20250429
final Optional<ToolTextEditor20250429> toolTextEditor20250429()
-
toolTextEditor20250728
final Optional<ToolTextEditor20250728> toolTextEditor20250728()
-
webSearchTool20250305
final Optional<WebSearchTool20250305> webSearchTool20250305()
-
webFetchTool20250910
final Optional<WebFetchTool20250910> webFetchTool20250910()
-
webSearchTool20260209
final Optional<WebSearchTool20260209> webSearchTool20260209()
-
webFetchTool20260209
final Optional<WebFetchTool20260209> webFetchTool20260209()
-
webFetchTool20260309
final Optional<WebFetchTool20260309> webFetchTool20260309()
Web fetch tool with use_cache parameter for bypassing cached content.
-
toolSearchToolBm25_20251119
final Optional<ToolSearchToolBm25_20251119> toolSearchToolBm25_20251119()
-
toolSearchToolRegex20251119
final Optional<ToolSearchToolRegex20251119> toolSearchToolRegex20251119()
-
isToolBash20250124
final Boolean isToolBash20250124()
-
isCodeExecutionTool20250522
final Boolean isCodeExecutionTool20250522()
-
isCodeExecutionTool20250825
final Boolean isCodeExecutionTool20250825()
-
isCodeExecutionTool20260120
final Boolean isCodeExecutionTool20260120()
-
isMemoryTool20250818
final Boolean isMemoryTool20250818()
-
isToolTextEditor20250124
final Boolean isToolTextEditor20250124()
-
isToolTextEditor20250429
final Boolean isToolTextEditor20250429()
-
isToolTextEditor20250728
final Boolean isToolTextEditor20250728()
-
isWebSearchTool20250305
final Boolean isWebSearchTool20250305()
-
isWebFetchTool20250910
final Boolean isWebFetchTool20250910()
-
isWebSearchTool20260209
final Boolean isWebSearchTool20260209()
-
isWebFetchTool20260209
final Boolean isWebFetchTool20260209()
-
isWebFetchTool20260309
final Boolean isWebFetchTool20260309()
-
isToolSearchToolBm25_20251119
final Boolean isToolSearchToolBm25_20251119()
-
isToolSearchToolRegex20251119
final Boolean isToolSearchToolRegex20251119()
-
asToolBash20250124
final ToolBash20250124 asToolBash20250124()
-
asCodeExecutionTool20250522
final CodeExecutionTool20250522 asCodeExecutionTool20250522()
-
asCodeExecutionTool20250825
final CodeExecutionTool20250825 asCodeExecutionTool20250825()
-
asCodeExecutionTool20260120
final CodeExecutionTool20260120 asCodeExecutionTool20260120()
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
asMemoryTool20250818
final MemoryTool20250818 asMemoryTool20250818()
-
asToolTextEditor20250124
final ToolTextEditor20250124 asToolTextEditor20250124()
-
asToolTextEditor20250429
final ToolTextEditor20250429 asToolTextEditor20250429()
-
asToolTextEditor20250728
final ToolTextEditor20250728 asToolTextEditor20250728()
-
asWebSearchTool20250305
final WebSearchTool20250305 asWebSearchTool20250305()
-
asWebFetchTool20250910
final WebFetchTool20250910 asWebFetchTool20250910()
-
asWebSearchTool20260209
final WebSearchTool20260209 asWebSearchTool20260209()
-
asWebFetchTool20260209
final WebFetchTool20260209 asWebFetchTool20260209()
-
asWebFetchTool20260309
final WebFetchTool20260309 asWebFetchTool20260309()
Web fetch tool with use_cache parameter for bypassing cached content.
-
asToolSearchToolBm25_20251119
final ToolSearchToolBm25_20251119 asToolSearchToolBm25_20251119()
-
asToolSearchToolRegex20251119
final ToolSearchToolRegex20251119 asToolSearchToolRegex20251119()
-
accept
final <T extends Any> T accept(MessageCountTokensTool.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 = messageCountTokensTool.accept(new MessageCountTokensTool.Visitor<Optional<String>>() { @Override public Optional<String> visitTool(Tool tool) { return Optional.of(tool.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final MessageCountTokensTool 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.
-
ofTool
final static MessageCountTokensTool ofTool(Tool tool)
-
ofToolBash20250124
final static MessageCountTokensTool ofToolBash20250124(ToolBash20250124 toolBash20250124)
-
ofCodeExecutionTool20250522
final static MessageCountTokensTool ofCodeExecutionTool20250522(CodeExecutionTool20250522 codeExecutionTool20250522)
-
ofCodeExecutionTool20250825
final static MessageCountTokensTool ofCodeExecutionTool20250825(CodeExecutionTool20250825 codeExecutionTool20250825)
-
ofCodeExecutionTool20260120
final static MessageCountTokensTool ofCodeExecutionTool20260120(CodeExecutionTool20260120 codeExecutionTool20260120)
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
-
ofMemoryTool20250818
final static MessageCountTokensTool ofMemoryTool20250818(MemoryTool20250818 memoryTool20250818)
-
ofToolTextEditor20250124
final static MessageCountTokensTool ofToolTextEditor20250124(ToolTextEditor20250124 toolTextEditor20250124)
-
ofToolTextEditor20250429
final static MessageCountTokensTool ofToolTextEditor20250429(ToolTextEditor20250429 toolTextEditor20250429)
-
ofToolTextEditor20250728
final static MessageCountTokensTool ofToolTextEditor20250728(ToolTextEditor20250728 toolTextEditor20250728)
-
ofWebSearchTool20250305
final static MessageCountTokensTool ofWebSearchTool20250305(WebSearchTool20250305 webSearchTool20250305)
-
ofWebFetchTool20250910
final static MessageCountTokensTool ofWebFetchTool20250910(WebFetchTool20250910 webFetchTool20250910)
-
ofWebSearchTool20260209
final static MessageCountTokensTool ofWebSearchTool20260209(WebSearchTool20260209 webSearchTool20260209)
-
ofWebFetchTool20260209
final static MessageCountTokensTool ofWebFetchTool20260209(WebFetchTool20260209 webFetchTool20260209)
-
ofWebFetchTool20260309
final static MessageCountTokensTool ofWebFetchTool20260309(WebFetchTool20260309 webFetchTool20260309)
Web fetch tool with use_cache parameter for bypassing cached content.
-
ofToolSearchToolBm25_20251119
final static MessageCountTokensTool ofToolSearchToolBm25_20251119(ToolSearchToolBm25_20251119 toolSearchToolBm25_20251119)
-
ofToolSearchToolRegex20251119
final static MessageCountTokensTool ofToolSearchToolRegex20251119(ToolSearchToolRegex20251119 toolSearchToolRegex20251119)
-
-
-
-