> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Judge • Rust AI Agent SDK

> Judge: A judge for evaluating outputs.

# Judge

> Defined in the [**eval**](../modules/eval) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

A judge for evaluating outputs.

## Fields

| Name        | Type          | Description           |
| ----------- | ------------- | --------------------- |
| `name`      | `String`      | Judge name            |
| `config`    | `JudgeConfig` | Configuration         |
| `threshold` | `f64`         | Threshold for passing |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(name: impl Into<String>) -> Self
```

Create a new judge.

**Parameters:**

| Name   | Type                      |
| ------ | ------------------------- |
| `name` | `impl Into&lt;String&gt;` |

### `with_config`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn with_config(mut self, config: JudgeConfig) -> Self
```

Set configuration.

**Parameters:**

| Name     | Type          |
| -------- | ------------- |
| `config` | `JudgeConfig` |

### `with_threshold`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn with_threshold(mut self, threshold: f64) -> Self
```

Set threshold.

**Parameters:**

| Name        | Type  |
| ----------- | ----- |
| `threshold` | `f64` |

### `judge`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn judge(&self, _input: &str, _output: &str, _expected: Option<&str>) -> JudgeResult
```

Judge an output (placeholder - would use LLM in real implementation).

**Parameters:**

| Name        | Type                 |
| ----------- | -------------------- |
| `_input`    | `&str`               |
| `_output`   | `&str`               |
| `_expected` | `Option&lt;&str&gt;` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/eval/mod.rs#L749">
  `praisonai/src/eval/mod.rs` at line 749
</Card>
