load_evaluator#

langchain.evaluation.loading.load_evaluator(evaluator: EvaluatorType, *, llm: BaseLanguageModel | None = None, **kwargs: Any) Chain | StringEvaluator[source]#

Load the requested evaluation chain specified by a string.

Parameters:
  • evaluator (EvaluatorType) – The type of evaluator to load.

  • llm (BaseLanguageModel, optional) – The language model to use for evaluation, by default None

  • **kwargs (Any) – Additional keyword arguments to pass to the evaluator.

Returns:

The loaded evaluation chain.

Return type:

Chain

Examples

>>> from langchain.evaluation import load_evaluator, EvaluatorType
>>> evaluator = load_evaluator(EvaluatorType.QA)