Home / Function/ _evaluate_string_pairs() — langchain Function Reference

_evaluate_string_pairs() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  06371274_4c90_26da_3a86_0757828f2835["_evaluate_string_pairs()"]
  a279fd93_b575_438d_176b_7abfe52f575d["PairwiseEmbeddingDistanceEvalChain"]
  06371274_4c90_26da_3a86_0757828f2835 -->|defined in| a279fd93_b575_438d_176b_7abfe52f575d
  fbbf6b20_ebdc_5396_8597_95686297918e["_prepare_output()"]
  06371274_4c90_26da_3a86_0757828f2835 -->|calls| fbbf6b20_ebdc_5396_8597_95686297918e
  style 06371274_4c90_26da_3a86_0757828f2835 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/embedding_distance/base.py lines 588–621

    def _evaluate_string_pairs(
        self,
        *,
        prediction: str,
        prediction_b: str,
        callbacks: Callbacks = None,
        tags: list[str] | None = None,
        metadata: dict[str, Any] | None = None,
        include_run_info: bool = False,
        **kwargs: Any,
    ) -> dict:
        """Evaluate the embedding distance between two predictions.

        Args:
            prediction: The output string from the first model.
            prediction_b: The output string from the second model.
            callbacks: The callbacks to use.
            tags: The tags to apply.
            metadata: The metadata to use.
            include_run_info: Whether to include run information in the output.
            **kwargs: Additional keyword arguments.

        Returns:
            `dict` containing:
                - score: The embedding distance between the two predictions.
        """
        result = self(
            inputs={"prediction": prediction, "prediction_b": prediction_b},
            callbacks=callbacks,
            tags=tags,
            metadata=metadata,
            include_run_info=include_run_info,
        )
        return self._prepare_output(result)

Domain

Subdomains

Frequently Asked Questions

What does _evaluate_string_pairs() do?
_evaluate_string_pairs() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/embedding_distance/base.py.
Where is _evaluate_string_pairs() defined?
_evaluate_string_pairs() is defined in libs/langchain/langchain_classic/evaluation/embedding_distance/base.py at line 588.
What does _evaluate_string_pairs() call?
_evaluate_string_pairs() calls 1 function(s): _prepare_output.

Analyze Your Own Codebase

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

Try Supermodel Free