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
  1e6583e3_4fcb_5943_1229_d0bcd6903c51["_evaluate_strings()"]
  3bfa222e_74bd_6c80_db4a_a3d3a09b5e7b["StringEvaluator"]
  1e6583e3_4fcb_5943_1229_d0bcd6903c51 -->|defined in| 3bfa222e_74bd_6c80_db4a_a3d3a09b5e7b
  89b45341_33d2_f0e2_5126_1ae243434a47["evaluate_strings()"]
  89b45341_33d2_f0e2_5126_1ae243434a47 -->|calls| 1e6583e3_4fcb_5943_1229_d0bcd6903c51
  style 1e6583e3_4fcb_5943_1229_d0bcd6903c51 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/schema.py lines 154–176

    def _evaluate_strings(
        self,
        *,
        prediction: str | Any,
        reference: str | Any | None = None,
        input: str | Any | 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.
            It is recommended that the dictionary contain the following keys:
                 - score: the score of the evaluation, if applicable.
                 - value: the string value of the evaluation, if applicable.
                 - reasoning: the reasoning for the evaluation, if applicable.
        """

Domain

Subdomains

Called By

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 154.
What calls _evaluate_strings()?
_evaluate_strings() is called by 1 function(s): evaluate_strings.

Analyze Your Own Codebase

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

Try Supermodel Free