Home / Function/ apply() — langchain Function Reference

apply() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7a36ae88_8593_94b3_c690_1df5007cf67d["apply()"]
  f3cef70e_11b0_61c9_7ec0_7308f4b45056["Chain"]
  7a36ae88_8593_94b3_c690_1df5007cf67d -->|defined in| f3cef70e_11b0_61c9_7ec0_7308f4b45056
  style 7a36ae88_8593_94b3_c690_1df5007cf67d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/base.py lines 800–806

    def apply(
        self,
        input_list: list[builtins.dict[str, Any]],
        callbacks: Callbacks = None,
    ) -> list[builtins.dict[str, str]]:
        """Call the chain on all inputs in the list."""
        return [self(inputs, callbacks=callbacks) for inputs in input_list]

Subdomains

Frequently Asked Questions

What does apply() do?
apply() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/base.py.
Where is apply() defined?
apply() is defined in libs/langchain/langchain_classic/chains/base.py at line 800.

Analyze Your Own Codebase

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

Try Supermodel Free