_call() — langchain Function Reference
Architecture documentation for the _call() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 55bba962_c474_7d72_fad4_2419ad83c3a7["_call()"] a279fd93_b575_438d_176b_7abfe52f575d["PairwiseEmbeddingDistanceEvalChain"] 55bba962_c474_7d72_fad4_2419ad83c3a7 -->|defined in| a279fd93_b575_438d_176b_7abfe52f575d b87deb74_80b9_1b59_d7bb_3ea345fa69b3["_call()"] b87deb74_80b9_1b59_d7bb_3ea345fa69b3 -->|calls| 55bba962_c474_7d72_fad4_2419ad83c3a7 af8d1584_7461_17c4_1dc0_409b11712821["_compute_score()"] 55bba962_c474_7d72_fad4_2419ad83c3a7 -->|calls| af8d1584_7461_17c4_1dc0_409b11712821 b87deb74_80b9_1b59_d7bb_3ea345fa69b3["_call()"] 55bba962_c474_7d72_fad4_2419ad83c3a7 -->|calls| b87deb74_80b9_1b59_d7bb_3ea345fa69b3 91b8ba41_75bf_8afd_e893_d85d055226da["_check_numpy()"] 55bba962_c474_7d72_fad4_2419ad83c3a7 -->|calls| 91b8ba41_75bf_8afd_e893_d85d055226da caa53c2b_01ef_7204_a5e6_ad683c86dbd2["_import_numpy()"] 55bba962_c474_7d72_fad4_2419ad83c3a7 -->|calls| caa53c2b_01ef_7204_a5e6_ad683c86dbd2 style 55bba962_c474_7d72_fad4_2419ad83c3a7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/evaluation/embedding_distance/base.py lines 534–558
def _call(
self,
inputs: dict[str, Any],
run_manager: CallbackManagerForChainRun | None = None,
) -> dict[str, Any]:
"""Compute the score for two predictions.
Args:
inputs: The input data.
run_manager: The callback manager.
Returns:
The computed score.
"""
vectors = self.embeddings.embed_documents(
[
inputs["prediction"],
inputs["prediction_b"],
],
)
if _check_numpy():
np = _import_numpy()
vectors = np.array(vectors)
score = self._compute_score(vectors)
return {"score": score}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _call() do?
_call() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/embedding_distance/base.py.
Where is _call() defined?
_call() is defined in libs/langchain/langchain_classic/evaluation/embedding_distance/base.py at line 534.
What does _call() call?
_call() calls 4 function(s): _call, _check_numpy, _compute_score, _import_numpy.
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