langsmith.evaluation.evaluator.DynamicRunEvaluator#
- class langsmith.evaluation.evaluator.DynamicRunEvaluator(func: Callable[[Run, Example | None], EvaluationResult | EvaluationResults | dict | Awaitable[EvaluationResult | EvaluationResults | dict]], afunc: Callable[[Run, Example | None], Awaitable[EvaluationResult | EvaluationResults | dict]] | None = None)[source]#
A dynamic evaluator that wraps a function and transforms it into a RunEvaluator.
This class is designed to be used with the @run_evaluator decorator, allowing functions that take a Run and an optional Example as arguments, and return an EvaluationResult or EvaluationResults, to be used as instances of RunEvaluator.
- func#
The function that is wrapped by this evaluator.
- Type:
Callable
Initialize the DynamicRunEvaluator with a given function.