Home / Class/ BetaFunctionTool Class — anthropic-sdk-python Architecture

BetaFunctionTool Class — anthropic-sdk-python Architecture

Architecture documentation for the BetaFunctionTool class in _beta_functions.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  60a3b209_180b_0680_57e3_9ebdfc101d6b["BetaFunctionTool"]
  2f4a4b61_2541_5c7b_c70e_93f4b752f987["_beta_functions.py"]
  60a3b209_180b_0680_57e3_9ebdfc101d6b -->|defined in| 2f4a4b61_2541_5c7b_c70e_93f4b752f987
  a8a826cb_6a24_e00c_d9e5_15019ac4edb0["call()"]
  60a3b209_180b_0680_57e3_9ebdfc101d6b -->|method| a8a826cb_6a24_e00c_d9e5_15019ac4edb0

Relationship Graph

Source Code

src/anthropic/lib/tools/_beta_functions.py lines 177–188

class BetaFunctionTool(BaseFunctionTool[FunctionT]):
    def call(self, input: object) -> BetaFunctionToolResultType:
        if iscoroutinefunction(self.func):
            raise RuntimeError("Cannot call a coroutine function synchronously. Use `@async_tool` instead.")

        if not is_dict(input):
            raise TypeError(f"Input must be a dictionary, got {type(input).__name__}")

        try:
            return self._func_with_validate(**cast(Any, input))
        except pydantic.ValidationError as e:
            raise ValueError(f"Invalid arguments for function {self.name}") from e

Frequently Asked Questions

What is the BetaFunctionTool class?
BetaFunctionTool is a class in the anthropic-sdk-python codebase, defined in src/anthropic/lib/tools/_beta_functions.py.
Where is BetaFunctionTool defined?
BetaFunctionTool is defined in src/anthropic/lib/tools/_beta_functions.py at line 177.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free