Home / Function/ add_metadata() — langchain Function Reference

add_metadata() — langchain Function Reference

Architecture documentation for the add_metadata() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c98c3756_41e0_73ad_cf46_70fd4638a995["add_metadata()"]
  24bc19d6_d1f4_bd59_6fc4_6ef5b08a4d41["BaseCallbackManager"]
  c98c3756_41e0_73ad_cf46_70fd4638a995 -->|defined in| 24bc19d6_d1f4_bd59_6fc4_6ef5b08a4d41
  style c98c3756_41e0_73ad_cf46_70fd4638a995 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/base.py lines 1091–1104

    def add_metadata(
        self,
        metadata: dict[str, Any],
        inherit: bool = True,  # noqa: FBT001,FBT002
    ) -> None:
        """Add metadata to the callback manager.

        Args:
            metadata: The metadata to add.
            inherit: Whether to inherit the metadata.
        """
        self.metadata.update(metadata)
        if inherit:
            self.inheritable_metadata.update(metadata)

Domain

Subdomains

Frequently Asked Questions

What does add_metadata() do?
add_metadata() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/base.py.
Where is add_metadata() defined?
add_metadata() is defined in libs/core/langchain_core/callbacks/base.py at line 1091.

Analyze Your Own Codebase

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

Try Supermodel Free