compute_metric() — langchain Function Reference
Architecture documentation for the compute_metric() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 5ca4db2b_adc2_0733_78d9_bd519d1ec89b["compute_metric()"] 5c42d4f5_4dcc_bdad_cf78_f643b26ab2eb["_RapidFuzzChainMixin"] 5ca4db2b_adc2_0733_78d9_bd519d1ec89b -->|defined in| 5c42d4f5_4dcc_bdad_cf78_f643b26ab2eb b38504e1_941f_08be_f726_d0f7bc1ce3fa["_call()"] b38504e1_941f_08be_f726_d0f7bc1ce3fa -->|calls| 5ca4db2b_adc2_0733_78d9_bd519d1ec89b 67b45def_893b_6cc7_ba13_893c80642403["_acall()"] 67b45def_893b_6cc7_ba13_893c80642403 -->|calls| 5ca4db2b_adc2_0733_78d9_bd519d1ec89b cf6188b8_533c_de49_feb5_b7617d9319ea["_call()"] cf6188b8_533c_de49_feb5_b7617d9319ea -->|calls| 5ca4db2b_adc2_0733_78d9_bd519d1ec89b 26aeaa7f_8a64_e9f8_b6bf_e561c2708a27["_acall()"] 26aeaa7f_8a64_e9f8_b6bf_e561c2708a27 -->|calls| 5ca4db2b_adc2_0733_78d9_bd519d1ec89b 49290d01_62f4_4e49_fdf7_9c4174a4ba2e["metric()"] 5ca4db2b_adc2_0733_78d9_bd519d1ec89b -->|calls| 49290d01_62f4_4e49_fdf7_9c4174a4ba2e style 5ca4db2b_adc2_0733_78d9_bd519d1ec89b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/evaluation/string_distance/base.py lines 152–162
def compute_metric(self, a: str, b: str) -> float:
"""Compute the distance between two strings.
Args:
a: The first string.
b: The second string.
Returns:
The distance between the two strings.
"""
return self.metric(a, b)
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does compute_metric() do?
compute_metric() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py.
Where is compute_metric() defined?
compute_metric() is defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py at line 152.
What does compute_metric() call?
compute_metric() calls 1 function(s): metric.
What calls compute_metric()?
compute_metric() is called by 4 function(s): _acall, _acall, _call, _call.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free