---
title: Evaluation
seo:
  title: Evaluation — TypeScript SDK
  description: >-
    Score a batch of examples using hosted scorers or Code judges. (TypeScript
    SDK)
description: Score a batch of examples using hosted scorers or Code judges.
---

Two modes are supported:

* **Hosted scorers** — pass scorer names as strings (e.g.
  `"faithfulness"`, `"answer_relevancy"`). Evaluation runs server-side
  on the Judgment platform.
* **Code judges** — pass Judge subclass instances for
  in-process evaluation with your own scoring logic.

Create an `Evaluation` via `client.evaluation.create()`, then call
`.run()` to execute scorers against your examples.

```typescript
const evaluation = client.evaluation.create();
const results = await evaluation.run({
  examples,
  scorers: ["faithfulness", "answer_relevancy"],
  evalRunName: "nightly-eval",
});
```

## run()

Run scorers against your examples and return results.

Pass **either** hosted scorer names (strings) **or** Code judge (Judge)
instances. Mixing both in one call is not supported.

```typescript
async function run(options: EvaluationRunOptions): Promise<ScoringResult[]>
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `options` | `EvaluationRunOptions` | - | Evaluation configuration including examples, scorers, and run name. |

### Returns

`Promise<ScoringResult[]>` - A list of ScoringResult objects, one per example.
