Home / Function/ evaluate_strings() — langchain Function Reference

evaluate_strings() — langchain Function Reference

Architecture documentation for the evaluate_strings() function in schema.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  89b45341_33d2_f0e2_5126_1ae243434a47["evaluate_strings()"]
  3bfa222e_74bd_6c80_db4a_a3d3a09b5e7b["StringEvaluator"]
  89b45341_33d2_f0e2_5126_1ae243434a47 -->|defined in| 3bfa222e_74bd_6c80_db4a_a3d3a09b5e7b
  7026853a_ec84_d1d0_4656_2bb45a043e17["_check_evaluation_args()"]
  89b45341_33d2_f0e2_5126_1ae243434a47 -->|calls| 7026853a_ec84_d1d0_4656_2bb45a043e17
  1e6583e3_4fcb_5943_1229_d0bcd6903c51["_evaluate_strings()"]
  89b45341_33d2_f0e2_5126_1ae243434a47 -->|calls| 1e6583e3_4fcb_5943_1229_d0bcd6903c51
  style 89b45341_33d2_f0e2_5126_1ae243434a47 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/schema.py lines 210–235

    def evaluate_strings(
        self,
        *,
        prediction: str,
        reference: str | None = None,
        input: str | None = None,  # noqa: A002
        **kwargs: Any,
    ) -> dict:
        """Evaluate Chain or LLM output, based on optional input and label.

        Args:
            prediction: The LLM or chain prediction to evaluate.
            reference: The reference label to evaluate against.
            input: The input to consider during evaluation.
            **kwargs: Additional keyword arguments, including callbacks, tags, etc.

        Returns:
            The evaluation results containing the score or value.
        """
        self._check_evaluation_args(reference=reference, input_=input)
        return self._evaluate_strings(
            prediction=prediction,
            reference=reference,
            input=input,
            **kwargs,
        )

Domain

Subdomains

Frequently Asked Questions

What does evaluate_strings() do?
evaluate_strings() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/schema.py.
Where is evaluate_strings() defined?
evaluate_strings() is defined in libs/langchain/langchain_classic/evaluation/schema.py at line 210.
What does evaluate_strings() call?
evaluate_strings() calls 2 function(s): _check_evaluation_args, _evaluate_strings.

Analyze Your Own Codebase

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

Try Supermodel Free