Home / Function/ __eq__() — langchain Function Reference

__eq__() — langchain Function Reference

Architecture documentation for the __eq__() function in llm_result.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  78ef10a7_f558_70d3_357f_7f9d3b395633["__eq__()"]
  be2a68ad_6ac6_f078_3bbc_62ebfc7db505["LLMResult"]
  78ef10a7_f558_70d3_357f_7f9d3b395633 -->|defined in| be2a68ad_6ac6_f078_3bbc_62ebfc7db505
  style 78ef10a7_f558_70d3_357f_7f9d3b395633 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/outputs/llm_result.py lines 95–109

    def __eq__(self, other: object) -> bool:
        """Check for `LLMResult` equality by ignoring any metadata related to runs.

        Args:
            other: Another `LLMResult` object to compare against.

        Returns:
            `True` if the generations and `llm_output` are equal, `False` otherwise.
        """
        if not isinstance(other, LLMResult):
            return NotImplemented
        return (
            self.generations == other.generations
            and self.llm_output == other.llm_output
        )

Domain

Subdomains

Frequently Asked Questions

What does __eq__() do?
__eq__() is a function in the langchain codebase, defined in libs/core/langchain_core/outputs/llm_result.py.
Where is __eq__() defined?
__eq__() is defined in libs/core/langchain_core/outputs/llm_result.py at line 95.

Analyze Your Own Codebase

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

Try Supermodel Free