Home / Function/ __getattr__() — langchain Function Reference

__getattr__() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  592f29b1_24ac_158c_3d57_5293a7a473d6["__getattr__()"]
  81476294_823b_1810_f20c_d97f2fdbfa71["EvalError"]
  592f29b1_24ac_158c_3d57_5293a7a473d6 -->|defined in| 81476294_823b_1810_f20c_d97f2fdbfa71
  style 592f29b1_24ac_158c_3d57_5293a7a473d6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/smith/evaluation/runner_utils.py lines 164–180

    def __getattr__(self, name: str) -> Any:
        """Get an attribute from the `EvalError`.

        Args:
            name: The name of the attribute to get.

        Returns:
            The value of the attribute.

        Raises:
            AttributeError: If the attribute does not exist.
        """
        try:
            return self[name]
        except KeyError as e:
            msg = f"'EvalError' object has no attribute '{name}'"
            raise AttributeError(msg) from e

Domain

Subdomains

Frequently Asked Questions

What does __getattr__() do?
__getattr__() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/smith/evaluation/runner_utils.py.
Where is __getattr__() defined?
__getattr__() is defined in libs/langchain/langchain_classic/smith/evaluation/runner_utils.py at line 164.

Analyze Your Own Codebase

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

Try Supermodel Free