Home / Function/ metric() — langchain Function Reference

metric() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  49290d01_62f4_4e49_fdf7_9c4174a4ba2e["metric()"]
  5c42d4f5_4dcc_bdad_cf78_f643b26ab2eb["_RapidFuzzChainMixin"]
  49290d01_62f4_4e49_fdf7_9c4174a4ba2e -->|defined in| 5c42d4f5_4dcc_bdad_cf78_f643b26ab2eb
  5ca4db2b_adc2_0733_78d9_bd519d1ec89b["compute_metric()"]
  5ca4db2b_adc2_0733_78d9_bd519d1ec89b -->|calls| 49290d01_62f4_4e49_fdf7_9c4174a4ba2e
  47ea03f1_ae34_6c9b_8db7_6adf9d7fb807["_get_metric()"]
  49290d01_62f4_4e49_fdf7_9c4174a4ba2e -->|calls| 47ea03f1_ae34_6c9b_8db7_6adf9d7fb807
  style 49290d01_62f4_4e49_fdf7_9c4174a4ba2e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/string_distance/base.py lines 141–150

    def metric(self) -> Callable:
        """Get the distance metric function.

        Returns:
            The distance metric function.
        """
        return _RapidFuzzChainMixin._get_metric(
            self.distance,
            normalize_score=self.normalize_score,
        )

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free