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
  e4d907fe_2a70_a74f_7098_b33f3bf0970c["__getattr__()"]
  0b8c6fa3_4c3c_dd4f_1dd2_b48dec0a20d3["__init__.py"]
  e4d907fe_2a70_a74f_7098_b33f3bf0970c -->|defined in| 0b8c6fa3_4c3c_dd4f_1dd2_b48dec0a20d3
  style e4d907fe_2a70_a74f_7098_b33f3bf0970c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

def __getattr__(name: str) -> Any:
    """Get attr name."""
    if name == "create_pandas_dataframe_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.pandas.{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/pandas/__init__.py.
Where is __getattr__() defined?
__getattr__() is defined in libs/langchain/langchain_classic/agents/agent_toolkits/pandas/__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