Home / Function/ _acall() — langchain Function Reference

_acall() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e["_acall()"]
  e6333041_afe4_af13_ee74_a7ac732f022f["EmbeddingDistanceEvalChain"]
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e -->|defined in| e6333041_afe4_af13_ee74_a7ac732f022f
  5cbc8187_38d5_da15_88a2_96912b92daeb["_acall()"]
  5cbc8187_38d5_da15_88a2_96912b92daeb -->|calls| 0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e
  af8d1584_7461_17c4_1dc0_409b11712821["_compute_score()"]
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e -->|calls| af8d1584_7461_17c4_1dc0_409b11712821
  5cbc8187_38d5_da15_88a2_96912b92daeb["_acall()"]
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e -->|calls| 5cbc8187_38d5_da15_88a2_96912b92daeb
  91b8ba41_75bf_8afd_e893_d85d055226da["_check_numpy()"]
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e -->|calls| 91b8ba41_75bf_8afd_e893_d85d055226da
  caa53c2b_01ef_7204_a5e6_ad683c86dbd2["_import_numpy()"]
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e -->|calls| caa53c2b_01ef_7204_a5e6_ad683c86dbd2
  style 0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/embedding_distance/base.py lines 407–431

    async def _acall(
        self,
        inputs: dict[str, Any],
        run_manager: AsyncCallbackManagerForChainRun | None = None,
    ) -> dict[str, Any]:
        """Asynchronously compute the score for a prediction and reference.

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

        Returns:
            The computed score.
        """
        vectors = await self.embeddings.aembed_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 _acall() do?
_acall() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/embedding_distance/base.py.
Where is _acall() defined?
_acall() is defined in libs/langchain/langchain_classic/evaluation/embedding_distance/base.py at line 407.
What does _acall() call?
_acall() calls 4 function(s): _acall, _check_numpy, _compute_score, _import_numpy.
What calls _acall()?
_acall() is called by 1 function(s): _acall.

Analyze Your Own Codebase

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

Try Supermodel Free