LabeledCriteria: {
    evaluatorType: "labeled_criteria";
    feedbackKey: undefined | string;
    formatEvaluatorInputs: EvaluatorInputFormatter;
    agentTools?: undefined | StructuredToolInterface[];
    chainOptions?: undefined | Partial<Omit<LLMEvalChainInput<EvalOutputType, BaseLanguageModelInterface>, "llm">>;
    criteria?: undefined | (CriteriaLike & (Record<string, string> | Criteria));
    distanceMetric?: undefined | EmbeddingDistanceType;
    embedding?: any;
    llm?: any;
}

Configuration to load a "LabeledCriteriaEvalChain" evaluator, which prompts an LLM to determine whether the model's prediction complies with the provided criteria and also provides a "ground truth" label for the evaluator to incorporate in its evaluation.

Type declaration

  • evaluatorType: "labeled_criteria"
  • feedbackKey: undefined | string
  • formatEvaluatorInputs: EvaluatorInputFormatter
  • OptionalagentTools?: undefined | StructuredToolInterface[]

    A list of tools available to the agent, for TrajectoryEvalChain.

  • OptionalchainOptions?: undefined | Partial<Omit<LLMEvalChainInput<EvalOutputType, BaseLanguageModelInterface>, "llm">>
  • Optionalcriteria?: undefined | (CriteriaLike & (Record<string, string> | Criteria))

    The criteria to use for the evaluator.

  • OptionaldistanceMetric?: undefined | EmbeddingDistanceType

    The distance metric to use for comparing the embeddings.

  • Optionalembedding?: any

    The embedding objects to vectorize the outputs.

  • Optionalllm?: any

The criteria to use for the evaluator.

The language model to use for the evaluator.

The configuration for the evaluator.

const evalConfig = {
evaluators: [LabeledCriteria("correctness")],
};
@example
```ts
const evalConfig = {
evaluators: [
LabeledCriteria({
"mentionsAllFacts": "Does the include all facts provided in the reference?"
})
],
const evalConfig = {
evaluators: [{
evaluatorType: "labeled_criteria",
criteria: "correctness",
formatEvaluatorInputs: ...
}],
};
const evalConfig = {
evaluators: [{
evaluatorType: "labeled_criteria",
criteria: { "mentionsAllFacts": "Does the include all facts provided in the reference?" },
formatEvaluatorInputs: ...
}],
""