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
  b87deb74_80b9_1b59_d7bb_3ea345fa69b3["_call()"]
  e6333041_afe4_af13_ee74_a7ac732f022f["EmbeddingDistanceEvalChain"]
  b87deb74_80b9_1b59_d7bb_3ea345fa69b3 -->|defined in| e6333041_afe4_af13_ee74_a7ac732f022f
  55bba962_c474_7d72_fad4_2419ad83c3a7["_call()"]
  55bba962_c474_7d72_fad4_2419ad83c3a7 -->|calls| b87deb74_80b9_1b59_d7bb_3ea345fa69b3
  af8d1584_7461_17c4_1dc0_409b11712821["_compute_score()"]
  b87deb74_80b9_1b59_d7bb_3ea345fa69b3 -->|calls| af8d1584_7461_17c4_1dc0_409b11712821
  55bba962_c474_7d72_fad4_2419ad83c3a7["_call()"]
  b87deb74_80b9_1b59_d7bb_3ea345fa69b3 -->|calls| 55bba962_c474_7d72_fad4_2419ad83c3a7
  91b8ba41_75bf_8afd_e893_d85d055226da["_check_numpy()"]
  b87deb74_80b9_1b59_d7bb_3ea345fa69b3 -->|calls| 91b8ba41_75bf_8afd_e893_d85d055226da
  caa53c2b_01ef_7204_a5e6_ad683c86dbd2["_import_numpy()"]
  b87deb74_80b9_1b59_d7bb_3ea345fa69b3 -->|calls| caa53c2b_01ef_7204_a5e6_ad683c86dbd2
  style b87deb74_80b9_1b59_d7bb_3ea345fa69b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/embedding_distance/base.py lines 383–404

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

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

        Returns:
            The computed score.
        """
        vectors = self.embeddings.embed_documents(
            [inputs["prediction"], inputs["reference"]],
        )
        if _check_numpy():
            np = _import_numpy()
            vectors = np.array(vectors)
        score = self._compute_score(vectors)
        return {"score": score}

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/embedding_distance/base.py.
Where is _call() defined?
_call() is defined in libs/langchain/langchain_classic/evaluation/embedding_distance/base.py at line 383.
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