LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicevaluationschemaPairwiseStringEvaluatorevaluate_string_pairs
    Method●Since v1.0

    evaluate_string_pairs

    Evaluate the output string pairs.

    Copy
    evaluate_string_pairs(
      self,
      *,
      prediction: str,
      prediction_b: str,
      reference: str | None = None,
      input: str | None = None,
      **kwargs: Any = {}
    ) -> dict

    Parameters

    NameTypeDescription
    prediction*str

    The output string from the first model.

    prediction_b*str

    The output string from the second model.

    referencestr | None
    Default:None

    The expected output / reference string.

    inputstr | None
    Default:None

    The input string.

    **kwargsAny
    Default:{}

    Additional keyword arguments, such as callbacks and optional reference strings.

    View source on GitHub