Home / Function/ _call() — langchain Function Reference

_call() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b38504e1_941f_08be_f726_d0f7bc1ce3fa["_call()"]
  bff7d7ab_1e8c_c321_eeec_49e7e15eca13["StringDistanceEvalChain"]
  b38504e1_941f_08be_f726_d0f7bc1ce3fa -->|defined in| bff7d7ab_1e8c_c321_eeec_49e7e15eca13
  cf6188b8_533c_de49_feb5_b7617d9319ea["_call()"]
  cf6188b8_533c_de49_feb5_b7617d9319ea -->|calls| b38504e1_941f_08be_f726_d0f7bc1ce3fa
  5ca4db2b_adc2_0733_78d9_bd519d1ec89b["compute_metric()"]
  b38504e1_941f_08be_f726_d0f7bc1ce3fa -->|calls| 5ca4db2b_adc2_0733_78d9_bd519d1ec89b
  cf6188b8_533c_de49_feb5_b7617d9319ea["_call()"]
  b38504e1_941f_08be_f726_d0f7bc1ce3fa -->|calls| cf6188b8_533c_de49_feb5_b7617d9319ea
  style b38504e1_941f_08be_f726_d0f7bc1ce3fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/string_distance/base.py lines 216–230

    def _call(
        self,
        inputs: dict[str, Any],
        run_manager: CallbackManagerForChainRun | None = None,
    ) -> dict[str, Any]:
        """Compute the string distance between the prediction and the reference.

        Args:
            inputs: The input values.
            run_manager: The callback manager.

        Returns:
            The evaluation results containing the score.
        """
        return {"score": self.compute_metric(inputs["reference"], inputs["prediction"])}

Domain

Subdomains

Called By

Frequently Asked Questions

What does _call() do?
_call() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py.
Where is _call() defined?
_call() is defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py at line 216.
What does _call() call?
_call() calls 2 function(s): _call, compute_metric.
What calls _call()?
_call() is called by 1 function(s): _call.

Analyze Your Own Codebase

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

Try Supermodel Free