Home / Function/ __getattr__() — langchain Function Reference

__getattr__() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  6bdbd89b_4352_bfa2_87ea_88bc511306bd["__getattr__()"]
  2b750ba0_fb85_98ff_ea5e_d1f0d0d38414["image.py"]
  6bdbd89b_4352_bfa2_87ea_88bc511306bd -->|defined in| 2b750ba0_fb85_98ff_ea5e_d1f0d0d38414
  style 6bdbd89b_4352_bfa2_87ea_88bc511306bd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/utils/image.py lines 6–15

def __getattr__(name: str) -> Any:
    if name in {"encode_image", "image_to_data_url"}:
        msg = (
            f"'{name}' has been removed for security reasons.\n\n"
            f"Usage of this utility in environments with user-input paths is a "
            f"security vulnerability. Out of an abundance of caution, the utility "
            f"has been removed to prevent possible misuse."
        )
        raise ValueError(msg)
    raise AttributeError(name)

Subdomains

Frequently Asked Questions

What does __getattr__() do?
__getattr__() is a function in the langchain codebase, defined in libs/core/langchain_core/utils/image.py.
Where is __getattr__() defined?
__getattr__() is defined in libs/core/langchain_core/utils/image.py at line 6.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free