---
title: AgentJudgeFactory
seo:
  title: AgentJudgeFactory — Python SDK
  description: >-
    Create and update prompt-based Agent Judges on the Judgment platform.
    (Python SDK)
description: Create and update prompt-based Agent Judges on the Judgment platform.
---

Access this via `client.agent_judges` — you don't instantiate it directly.

```python
client = Judgeval(project_name="my-project")

judge = client.agent_judges.create(
    name="helpfulness",
    prompt="Rate the assistant's helpfulness on a scale of 0 to 1.",
    model="gpt-5.2",
    score_type="numeric",
)

client.agent_judges.update(
    judge_id=judge.judge_id,
    prompt="Updated rubric prompt.",
)
```

## \_\_init\_\_()

```python
def __init__(client, project_id, project_name):
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `client` | `JudgmentSyncClient` | - | |
| `project_id` | `Optional[str]` | - | |
| `project_name` | `str` | - | |

***

## create()

Create a new Agent Judge.

```python
def create(*, name, prompt, model, score_type, description=None, judge_description=None, categories=None, min_score=None, max_score=None) -> typing.Optional:
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `name` | `str` | - | Unique judge name within the project. |
| `prompt` | `str` | - | Rubric prompt template used by the agent judge. |
| `model` | `str` | - | LiteLLM model id (e.g. "gpt-5.2"). |
| `score_type` | `ScoreType` | - | One of "numeric", "binary", or "categorical". |
| `description?` | `Optional[str]` | `None` | Description stored on the underlying scorer version. |
| `judge_description?` | `Optional[str]` | `None` | Description shown in the UI. |
| `categories?` | `Optional[List[Dict[str, Any]]]` | `None` | Choice list for categorical judges. |
| `min_score?` | `Optional[float]` | `None` | Lower bound for numeric judges (defaults to 0). |
| `max_score?` | `Optional[float]` | `None` | Upper bound for numeric judges (defaults to 1). |

### Returns

`typing.Optional` - The created `AgentJudge`, or `None` if the project is unresolved.

***

## update()

Update an existing Agent Judge.

Passing any of `prompt`, `model`, `categories`, `min_score`, or
`max_score` writes a new version of the underlying prompt scorer.
When `target_major_version` / `target_minor_version` are omitted,
the server auto-bumps the latest version's minor by 1 — matching
the UI's default "save" behaviour.

```python
def update(*, judge_id, prompt=None, model=None, score_type=None, description=None, judge_description=None, categories=None, min_score=None, max_score=None, source_major_version=None, source_minor_version=None, target_major_version=None, target_minor_version=None) -> typing.Optional:
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `judge_id` | `str` | - | ID of the judge to update. |
| `prompt?` | `Optional[str]` | `None` | New rubric prompt template. |
| `model?` | `Optional[str]` | `None` | New LiteLLM model id. |
| `score_type?` | `Optional[ScoreType]` | `None` | New score type (numeric, binary, categorical). |
| `description?` | `Optional[str]` | `None` | New scorer-version description. |
| `judge_description?` | `Optional[str]` | `None` | New UI-facing description. |
| `categories?` | `Optional[List[Dict[str, Any]]]` | `None` | New choices for categorical judges. |
| `min_score?` | `Optional[float]` | `None` | New lower bound for numeric judges. |
| `max_score?` | `Optional[float]` | `None` | New upper bound for numeric judges. |
| `source_major_version?` | `Optional[int]` | `None` | Major version to copy unspecified fields from. Defaults to the latest version. |
| `source_minor_version?` | `Optional[int]` | `None` | Minor version to copy unspecified fields from. Defaults to the latest version. |
| `target_major_version?` | `Optional[int]` | `None` | Major version to write to. Defaults to the current latest major. |
| `target_minor_version?` | `Optional[int]` | `None` | Minor version to write to. Defaults to latest minor + 1. |

### Returns

`typing.Optional` - The updated `AgentJudge`, or `None` if the project is unresolved.
