Home / Function/ __getattr__() — langchain Function Reference

__getattr__() — langchain Function Reference

Architecture documentation for the __getattr__() function in __init__.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  1fb915e6_2a19_3d97_972d_814277cd1bcf["__getattr__()"]
  0b4f95f3_5435_ab7b_515d_787070aeaac7["__init__.py"]
  1fb915e6_2a19_3d97_972d_814277cd1bcf -->|defined in| 0b4f95f3_5435_ab7b_515d_787070aeaac7
  style 1fb915e6_2a19_3d97_972d_814277cd1bcf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/agent_toolkits/xorbits/__init__.py lines 4–20

def __getattr__(name: str) -> Any:
    """Get attr name."""
    if name == "create_xorbits_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.xorbits.{name}` to "
            f"`langchain_experimental.agents.agent_toolkits.{name}`."
        )
        raise ImportError(msg)
    msg = f"{name} does not exist"
    raise AttributeError(msg)

Subdomains

Frequently Asked Questions

What does __getattr__() do?
__getattr__() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/agent_toolkits/xorbits/__init__.py.
Where is __getattr__() defined?
__getattr__() is defined in libs/langchain/langchain_classic/agents/agent_toolkits/xorbits/__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