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

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

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

    evaluate_string_pairs

    Copy
    evaluate_string_pairs(
      self,
      *,
      prediction: str,
      prediction_b: str,
      reference: str 
    View source on GitHub
    |
    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
    **kwargsAny
    Default:{}

    Evaluate the output string pairs.

    The input string.

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