DynamicComparisonRunEvaluator#
- class langsmith.evaluation.evaluator.DynamicComparisonRunEvaluator(
- func: Callable[[Sequence[Run], Example | None], ComparisonEvaluationResult | dict | Awaitable[ComparisonEvaluationResult | dict]],
- afunc: Callable[[Sequence[Run], Example | None], Awaitable[ComparisonEvaluationResult | dict]] | None = None,
Compare predictions (as traces) from 2 or more runs.
Initialize the DynamicRunEvaluator with a given function.
- Parameters:
Attributes
is_async
Check if the evaluator function is asynchronous.
Methods
__init__
(func[, afunc])Initialize the DynamicRunEvaluator with a given function.
acompare_runs
(runs[, example])Evaluate a run asynchronously using the wrapped async function.
compare_runs
(runs[, example])Compare runs to score preferences.
- __init__(
- func: Callable[[Sequence[Run], Example | None], ComparisonEvaluationResult | dict | Awaitable[ComparisonEvaluationResult | dict]],
- afunc: Callable[[Sequence[Run], Example | None], Awaitable[ComparisonEvaluationResult | dict]] | None = None,
Initialize the DynamicRunEvaluator with a given function.
- Parameters:
func (Callable) – A function that takes a Run and an optional Example as
arguments
EvaluationResults. (and returns an EvaluationResult or)
afunc (Callable[[Sequence[Run], Example | None], Awaitable[ComparisonEvaluationResult | dict]] | None)
- async acompare_runs( ) ComparisonEvaluationResult [source]#
Evaluate a run asynchronously using the wrapped async function.
- This method directly invokes the wrapped async function with the
provided arguments.
- Parameters:
- Returns:
The result of the evaluation.
- Return type:
- compare_runs( ) ComparisonEvaluationResult [source]#
Compare runs to score preferences.
- Parameters:
- Return type: