# DynamicComparisonRunEvaluator

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/evaluation/evaluator/DynamicComparisonRunEvaluator)

Compare predictions (as traces) from 2 or more runs.

## Signature

```python
DynamicComparisonRunEvaluator(
    self,
    func: Callable[[Sequence[Run], Optional[Example]], Union[_COMPARISON_OUTPUT, Awaitable[_COMPARISON_OUTPUT]]],
    afunc: Optional[Callable[[Sequence[Run], Optional[Example]], Awaitable[_COMPARISON_OUTPUT]]] = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `func` | `Callable` | Yes | A function that takes a `Run` and an optional `Example` as |

## Constructors

```python
__init__(
    self,
    func: Callable[[Sequence[Run], Optional[Example]], Union[_COMPARISON_OUTPUT, Awaitable[_COMPARISON_OUTPUT]]],
    afunc: Optional[Callable[[Sequence[Run], Optional[Example]], Awaitable[_COMPARISON_OUTPUT]]] = None,
)
```

| Name | Type |
|------|------|
| `func` | `Callable[[Sequence[Run], Optional[Example]], Union[_COMPARISON_OUTPUT, Awaitable[_COMPARISON_OUTPUT]]]` |
| `afunc` | `Optional[Callable[[Sequence[Run], Optional[Example]], Awaitable[_COMPARISON_OUTPUT]]]` |


## Properties

- `afunc`
- `func`
- `is_async`

## Methods

- [`compare_runs()`](https://reference.langchain.com/python/langsmith/evaluation/evaluator/DynamicComparisonRunEvaluator/compare_runs)
- [`acompare_runs()`](https://reference.langchain.com/python/langsmith/evaluation/evaluator/DynamicComparisonRunEvaluator/acompare_runs)

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/6a74bf5af9e542d8065af8edca54b2448f430916/python/langsmith/evaluation/evaluator.py#L416)