Home / Function/ _diff() — langchain Function Reference

_diff() — langchain Function Reference

Architecture documentation for the _diff() function in transform.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  384cee5b_46cc_97df_297f_6b4f798bb585["_diff()"]
  cd116ff8_eeee_c962_fbf2_a4040e45e224["BaseCumulativeTransformOutputParser"]
  384cee5b_46cc_97df_297f_6b4f798bb585 -->|defined in| cd116ff8_eeee_c962_fbf2_a4040e45e224
  2008ec55_bc9f_147f_6d4b_6628aad4262f["_transform()"]
  2008ec55_bc9f_147f_6d4b_6628aad4262f -->|calls| 384cee5b_46cc_97df_297f_6b4f798bb585
  style 384cee5b_46cc_97df_297f_6b4f798bb585 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/output_parsers/transform.py lines 107–123

    def _diff(
        self,
        prev: T | None,
        next: T,  # noqa: A002
    ) -> T:
        """Convert parsed outputs into a diff format.

        The semantics of this are up to the output parser.

        Args:
            prev: The previous parsed output.
            next: The current parsed output.

        Returns:
            The diff between the previous and current parsed output.
        """
        raise NotImplementedError

Domain

Subdomains

Called By

Frequently Asked Questions

What does _diff() do?
_diff() is a function in the langchain codebase, defined in libs/core/langchain_core/output_parsers/transform.py.
Where is _diff() defined?
_diff() is defined in libs/core/langchain_core/output_parsers/transform.py at line 107.
What calls _diff()?
_diff() is called by 1 function(s): _transform.

Analyze Your Own Codebase

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

Try Supermodel Free