__getattr__() — langchain Function Reference
Architecture documentation for the __getattr__() function in configurable.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 225301e6_e73c_25d0_7739_755d87cb7472["__getattr__()"] 018f968f_f1d1_6f85_05f3_0ff4abc12150["DynamicRunnable"] 225301e6_e73c_25d0_7739_755d87cb7472 -->|defined in| 018f968f_f1d1_6f85_05f3_0ff4abc12150 e71e4d88_aaa7_d3d0_06ac_43f60d5cd48a["prepare()"] 225301e6_e73c_25d0_7739_755d87cb7472 -->|calls| e71e4d88_aaa7_d3d0_06ac_43f60d5cd48a style 225301e6_e73c_25d0_7739_755d87cb7472 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/runnables/configurable.py lines 280–315
def __getattr__(self, name: str) -> Any: # type: ignore[misc]
attr = getattr(self.default, name)
if callable(attr):
@wraps(attr)
def wrapper(*args: Any, **kwargs: Any) -> Any:
for key, arg in kwargs.items():
if key == "config" and (
isinstance(arg, dict)
and "configurable" in arg
and isinstance(arg["configurable"], dict)
):
runnable, config = self.prepare(cast("RunnableConfig", arg))
kwargs = {**kwargs, "config": config}
return getattr(runnable, name)(*args, **kwargs)
for idx, arg in enumerate(args):
if (
isinstance(arg, dict)
and "configurable" in arg
and isinstance(arg["configurable"], dict)
):
runnable, config = self.prepare(cast("RunnableConfig", arg))
argsl = list(args)
argsl[idx] = config
return getattr(runnable, name)(*argsl, **kwargs)
if self.config:
runnable, config = self.prepare()
return getattr(runnable, name)(*args, **kwargs)
return attr(*args, **kwargs)
return wrapper
return attr
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does __getattr__() do?
__getattr__() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/configurable.py.
Where is __getattr__() defined?
__getattr__() is defined in libs/core/langchain_core/runnables/configurable.py at line 280.
What does __getattr__() call?
__getattr__() calls 1 function(s): prepare.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free