Home / Function/ __init__() — anthropic-sdk-python Function Reference

__init__() — anthropic-sdk-python Function Reference

Architecture documentation for the __init__() function in _beta_runner.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  dc2a0a3b_8495_0090_d41b_efe0dd8e4f77["__init__()"]
  74dfae5d_02b1_0e09_5e30_62a5a1ac1ac2["BaseToolRunner"]
  dc2a0a3b_8495_0090_d41b_efe0dd8e4f77 -->|defined in| 74dfae5d_02b1_0e09_5e30_62a5a1ac1ac2
  style dc2a0a3b_8495_0090_d41b_efe0dd8e4f77 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/tools/_beta_runner.py lines 64–83

    def __init__(
        self,
        *,
        params: ParseMessageCreateParamsBase[ResponseFormatT],
        options: RequestOptions,
        tools: Iterable[AnyFunctionToolT],
        max_iterations: int | None = None,
        compaction_control: CompactionControl | None = None,
    ) -> None:
        self._tools_by_name = {tool.name: tool for tool in tools}
        self._params: ParseMessageCreateParamsBase[ResponseFormatT] = {
            **params,
            "messages": [message for message in params["messages"]],
        }
        self._options = options
        self._messages_modified = False
        self._cached_tool_call_response: BetaMessageParam | None = None
        self._max_iterations = max_iterations
        self._iteration_count = 0
        self._compaction_control = compaction_control

Subdomains

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/tools/_beta_runner.py.
Where is __init__() defined?
__init__() is defined in src/anthropic/lib/tools/_beta_runner.py at line 64.

Analyze Your Own Codebase

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

Try Supermodel Free