langchain.d.ts 833 B

123456789101112131415161718192021
  1. import { type LoadEvaluatorOptions } from "langchain/evaluation";
  2. import type { Run, Example } from "../schemas.js";
  3. /**
  4. * @deprecated Use `evaluate` instead.
  5. *
  6. * This utility function loads a LangChain string evaluator and returns a function
  7. * which can be used by newer `evaluate` function.
  8. *
  9. * @param type Type of string evaluator, one of "criteria" or "labeled_criteria
  10. * @param options Options for loading the evaluator
  11. * @returns Evaluator consumable by `evaluate`
  12. */
  13. export declare function getLangchainStringEvaluator(type: "criteria" | "labeled_criteria", options: LoadEvaluatorOptions & {
  14. formatEvaluatorInputs?: (run: Run, example: Example) => {
  15. prediction: string;
  16. reference?: string;
  17. input?: string;
  18. };
  19. }): Promise<(run: Run, example: Example) => Promise<{
  20. key: string;
  21. }>>;