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
  5cbc8187_38d5_da15_88a2_96912b92daeb["_acall()"]
  a279fd93_b575_438d_176b_7abfe52f575d["PairwiseEmbeddingDistanceEvalChain"]
  5cbc8187_38d5_da15_88a2_96912b92daeb -->|defined in| a279fd93_b575_438d_176b_7abfe52f575d
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e["_acall()"]
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e -->|calls| 5cbc8187_38d5_da15_88a2_96912b92daeb
  af8d1584_7461_17c4_1dc0_409b11712821["_compute_score()"]
  5cbc8187_38d5_da15_88a2_96912b92daeb -->|calls| af8d1584_7461_17c4_1dc0_409b11712821
  0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e["_acall()"]
  5cbc8187_38d5_da15_88a2_96912b92daeb -->|calls| 0aaa55c8_a3a2_76b1_2dcd_56a0d3853e7e
  91b8ba41_75bf_8afd_e893_d85d055226da["_check_numpy()"]
  5cbc8187_38d5_da15_88a2_96912b92daeb -->|calls| 91b8ba41_75bf_8afd_e893_d85d055226da
  caa53c2b_01ef_7204_a5e6_ad683c86dbd2["_import_numpy()"]
  5cbc8187_38d5_da15_88a2_96912b92daeb -->|calls| caa53c2b_01ef_7204_a5e6_ad683c86dbd2
  style 5cbc8187_38d5_da15_88a2_96912b92daeb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/embedding_distance/base.py lines 561–585

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

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

        Returns:
            The computed score.
        """
        vectors = await self.embeddings.aembed_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

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 561.
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