Evaluate an example.
classmethod from_orm(obj: Any) → Model¶
classmethod from_run_and_data_type(evaluator: StringEvaluator, run_type: str, data_type: DataType, input_key: Optional[str] = None, prediction_key: Optional[str] = None, reference_key: Optional[str] = None, tags: Optional[List[str]] = None) → StringRunEvaluatorChain[source]¶
Create a StringRunEvaluatorChain from an evaluator and the run and dataset types.
This method provides an easy way to instantiate a StringRunEvaluatorChain, by
taking an evaluator and information about the type of run and the data.
The method supports LLM and chain runs.
Parameters
evaluator (StringEvaluator) – The string evaluator to use.
run_type (str) – The type of run being evaluated.
Supported types are LLM and Chain.
data_type (DataType) – The type of dataset used in the run.
input_key (str, optional) – The key used to map the input from the run.
prediction_key (str, optional) – The key used to map the prediction from the run.
reference_key (str, optional) – The key used to map the reference from the dataset.
tags (List[str], optional) – List of tags to attach to the evaluation chain.
Returns
The instantiated evaluation chain.
Return type
StringRunEvaluatorChain
Raises
ValueError – If the run type is not supported, or if the evaluator requires a
    reference from the dataset but the reference key is not provided.
classmethod get_lc_namespace() → List[str]¶
Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]