|
|
|
@ -160,7 +160,7 @@ class PairwiseStringEvalChain(PairwiseStringEvaluator, LLMEvalChain, LLMChain):
|
|
|
|
|
Example:
|
|
|
|
|
>>> from langchain.chat_models import ChatOpenAI
|
|
|
|
|
>>> from langchain.evaluation.comparison import PairwiseStringEvalChain
|
|
|
|
|
>>> llm = ChatOpenAI(temperature=0, model_name="gpt-4")
|
|
|
|
|
>>> llm = ChatOpenAI(temperature=0, model_name="gpt-4", model_kwargs={"random_seed": 42})
|
|
|
|
|
>>> chain = PairwiseStringEvalChain.from_llm(llm=llm)
|
|
|
|
|
>>> result = chain.evaluate_string_pairs(
|
|
|
|
|
... input = "What is the chemical formula for water?",
|
|
|
|
@ -179,7 +179,7 @@ class PairwiseStringEvalChain(PairwiseStringEvaluator, LLMEvalChain, LLMChain):
|
|
|
|
|
# . " by explaining what the formula means.\\n[[B]]"
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
""" # noqa: E501
|
|
|
|
|
|
|
|
|
|
output_key: str = "results" #: :meta private:
|
|
|
|
|
output_parser: BaseOutputParser = Field(
|
|
|
|
|