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

get_caller_name() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  917f996e_7ea0_140e_285d_acc3b0f76d69["get_caller_name()"]
  fd640620_de49_331e_578e_1d363467c440["utils.py"]
  917f996e_7ea0_140e_285d_acc3b0f76d69 -->|defined in| fd640620_de49_331e_578e_1d363467c440
  c3357c12_fcce_22ef_51b2_90f3c4331d2d["clear_locals()"]
  c3357c12_fcce_22ef_51b2_90f3c4331d2d -->|calls| 917f996e_7ea0_140e_285d_acc3b0f76d69
  style 917f996e_7ea0_140e_285d_acc3b0f76d69 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/lib/utils.py lines 47–55

def get_caller_name(*, stacklevel: int = 1) -> str:
    frame = inspect.currentframe()
    assert frame is not None

    for i in range(stacklevel):
        frame = frame.f_back
        assert frame is not None, f"no {i}th frame"

    return frame.f_code.co_name

Subdomains

Defined In

Called By

Frequently Asked Questions

What does get_caller_name() do?
get_caller_name() is a function in the anthropic-sdk-python codebase, defined in tests/lib/utils.py.
Where is get_caller_name() defined?
get_caller_name() is defined in tests/lib/utils.py at line 47.
What calls get_caller_name()?
get_caller_name() is called by 1 function(s): clear_locals.

Analyze Your Own Codebase

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

Try Supermodel Free