__getattr__() — langchain Function Reference
Architecture documentation for the __getattr__() function in __init__.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 915ac214_f780_0e47_7bbc_6accf173f77b["__getattr__()"] 951415b2_bac5_0e9b_5273_3a47be3a3fb9["__init__.py"] 915ac214_f780_0e47_7bbc_6accf173f77b -->|defined in| 951415b2_bac5_0e9b_5273_3a47be3a3fb9 style 915ac214_f780_0e47_7bbc_6accf173f77b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/agents/agent_toolkits/python/__init__.py lines 4–20
def __getattr__(name: str) -> Any:
"""Get attr name."""
if name == "create_python_agent":
msg = (
"This agent has been moved to langchain_experimental. "
"This agent relies on python REPL tool under the hood, so to use it "
"safely please sandbox the python REPL. "
"Read https://github.com/langchain-ai/langchain/blob/master/SECURITY.md "
"and https://github.com/langchain-ai/langchain/discussions/11680"
"To keep using this code as is, install langchain_experimental and "
"update your import statement from:\n"
f"`langchain_classic.agents.agent_toolkits.python.{name}` to "
f"`langchain_experimental.agents.agent_toolkits.{name}`."
)
raise ImportError(msg)
msg = f"{name} does not exist"
raise AttributeError(msg)
Domain
Subdomains
Source
Frequently Asked Questions
What does __getattr__() do?
__getattr__() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/agent_toolkits/python/__init__.py.
Where is __getattr__() defined?
__getattr__() is defined in libs/langchain/langchain_classic/agents/agent_toolkits/python/__init__.py at line 4.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free