Home / Function/ __radd__() — langchain Function Reference

__radd__() — langchain Function Reference

Architecture documentation for the __radd__() function in utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0b6e5ddd_e43f_3940_f51e_e2c325b3f556["__radd__()"]
  0872c285_c740_9d41_66b5_242bfb967e97["AddableDict"]
  0b6e5ddd_e43f_3940_f51e_e2c325b3f556 -->|defined in| 0872c285_c740_9d41_66b5_242bfb967e97
  style 0b6e5ddd_e43f_3940_f51e_e2c325b3f556 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/utils.py lines 490–509

    def __radd__(self, other: AddableDict) -> AddableDict:
        """Add this dictionary to another dictionary.

        Args:
            other: The other dictionary to be added to.

        Returns:
            A dictionary that is the result of adding the two dictionaries.
        """
        chunk = AddableDict(other)
        for key in self:
            if key not in chunk or chunk[key] is None:
                chunk[key] = self[key]
            elif self[key] is not None:
                try:
                    added = chunk[key] + self[key]
                except TypeError:
                    added = self[key]
                chunk[key] = added
        return chunk

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free