is_caller_internal() — langchain Function Reference
Architecture documentation for the is_caller_internal() function in internal.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 436c48f9_e5bc_b555_bab4_342c31262ce3["is_caller_internal()"] 81f58f07_9536_25f5_f07b_8e541292f8fc["internal.py"] 436c48f9_e5bc_b555_bab4_342c31262ce3 -->|defined in| 81f58f07_9536_25f5_f07b_8e541292f8fc style 436c48f9_e5bc_b555_bab4_342c31262ce3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/_api/internal.py lines 5–23
def is_caller_internal(depth: int = 2) -> bool:
"""Return whether the caller at `depth` of this function is internal."""
try:
frame = inspect.currentframe()
except AttributeError:
return False
if frame is None:
return False
try:
for _ in range(depth):
frame = frame.f_back
if frame is None:
return False
# Directly access the module name from the frame's global variables
module_globals = frame.f_globals
caller_module_name = cast("str", module_globals.get("__name__", ""))
return caller_module_name.startswith("langchain")
finally:
del frame
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does is_caller_internal() do?
is_caller_internal() is a function in the langchain codebase, defined in libs/core/langchain_core/_api/internal.py.
Where is is_caller_internal() defined?
is_caller_internal() is defined in libs/core/langchain_core/_api/internal.py at line 5.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free