品質ルーブリック エバリュエーターは、アプリケーションの適切な動作を定義する条件に対してエージェントまたはモデルの応答をスコア付けします。 LLM ジャッジは、各条件 (ディメンション) をスコア付けし、結果を総合スコアに結合します。
品質ルーブリックを使用して、エージェントがビジネス ルールに従うか、ツールを正しく使用するか、重要な詳細を確認するかなど、ドメイン固有の動作を測定します。 ルーブリックの種類とライフサイクル管理については、 Rubric エバリュエーターを参照してください。
スコアリング モードを選択する
各ルーブリックは、すべてのディメンションに対して 1 つのスコアリング モードを使用します。
| スコアリング モード | スコア付け方法 | 最適な用途 |
|---|---|---|
1 から 5 の評価 ("likert"、既定) |
各ディメンションを 1 から 5 に評価し、評価を 0.0 から 1.0までのスコアに結合します。 スコアが pass_threshold (既定の 0.5) を満たすと、項目は渡されます。 |
一部の基準が他の基準よりも重要なグレード品質 |
成功/失敗 ("boolean") |
各ディメンションをチェックします。 項目は、該当するすべてのチェックに合格した場合にのみ合格します。 | 必須のチェックリスト |
1 から 5 の評価モードでは、寸法を 1 から 10に重み付けできます。 すべてのディメンションに重みを付けるか、重み付けしないかのどちらかです。 合格/失敗モードでは、重みはサポートされません。
品質ルーブリックを生成する
サポートされているジャッジ モデルを含むルーブリックを、次の 1 つ以上のソースから生成します。
| Source | type |
使用するもの |
|---|---|---|
| Foundry エージェント | agent |
プロンプト エージェントの指示またはホストされるエージェントの説明 |
| Prompt | prompt |
記述する手順または品質目標 |
| Dataset | dataset |
ドメインのガイドラインまたは仕様を含む登録済みデータセット |
| Traces | traces |
Application Insights からの運用トレース。 トレースを少なくとも 1 つの他のソースと結合します。 |
入力が薄すぎる場合でも、生成は成功しますが、入力品質の警告が返されます。 ソースにさらに詳細を追加し、再生成します。
- Foundry プロジェクトで、 Evaluation>Evaluator カタログに移動し、[ エバリュエーターの作成 ] ウィンドウを開きます。
- エバリュエーター名を入力します。 必要に応じて、 表示名 と 説明を追加します。
- エバリュエーターの種類として、Rubric を選択します。 [ カテゴリ] で、[ 品質] を選択します。
- スコアリング方法の場合は、1 ~ 5 の評価に数値を選択し、合格/失敗の場合はブール値を選択します。
- [ルーブリックの自動生成] をオンにします。
- [モデル] で、サポートされているジャッジ モデルを選択します。 必要に応じて、 ターゲット エージェントを選択します。
- プロンプトで、エバリュエーターが評価する必要がある内容 (条件や期待される動作を含む) を説明します。
- 必要に応じて、[ コンテキストの追加] をオンにします。
[ターゲット エージェントから実稼働トレースを使用する] を選択するか、[Upload context files]\(コンテキスト ファイルのアップロード\) で
.json、.jsonl、.csv、または.txtファイルをアップロードします。 - エバリュエーターを作成します。 生成が完了したら、生成されたディメンションを確認します。
生成されたルーブリックは、新しいエバリュエーター バージョンとして保存されます。 ディメンションを確認し、評価 を実行 します。
ジャッジ モデルを選択する
品質ルーブリックの生成とスコアリングでは、次のモデルがサポートされています。
| Model | Recommendation |
|---|---|
gpt-5.5、 gpt-5.4、 gpt-5.4-nano、 gpt-5.2、 gpt-5.1、 gpt-5、 gpt-5-mini、 gpt-5-nano |
推奨 |
gpt-5.4-mini |
推奨 (パフォーマンスとコストの最適なバランス) |
gpt-4.1、gpt-4o |
許容範囲内 |
品質ルーブリックを手動で作成する
ルーブリックを自分で書くこともできます。 ポータルで、[エバリュエーターの作成] ウィンドウで [ルーブリックの自動生成] をオフにします。 コードでは、 project.evaluators.create_versionを使用します。 例については、「 評価の実行」を参照してください。
Tip
生成されたルーブリックから始めて、それを絞り込みます。 生成により、標準に合わせて調整できる基になったベースラインが提供されます。
ディメンション フィールド
品質ルーブリックは最大20の寸法を持つことができます。
| フィールド | Required | Description |
|---|---|---|
id |
Yes | 安定した snake_case 識別子。 履歴が接続された状態を維持するようにディメンションを編集する場合は、変更しないでください。 |
description |
Yes | 明確で観測可能な基準。 |
weight |
No |
1から10への相対的な重要度。 1 ~ 5 の評価モードのみ。 |
always_applicable |
No |
trueすると、ジャッジは、最初にディメンションが適用されるかどうかを確認するのではなく、常にディメンションをスコア付けします。 生成された 1 ~ 5 個のルーブリックは、これをキャッチオール general_quality ディメンションに設定します。 |
完全なスキーマについては、 Foundry REST API リファレンスを参照してください。
ルーブリックの例
次のルーブリックは、レストラン予約エージェントを評価します。
このルーブリックは、意図認識を最も大きく重み付けします。
{
"type": "rubric",
"scoring": { "mode": "likert" },
"pass_threshold": 0.5,
"dimensions": [
{
"id": "intent_recognition",
"description": "Correctly identifies the user's reservation intent (book, modify, cancel, inquire) and pursues the appropriate workflow without unnecessary clarification.",
"weight": 9
},
{
"id": "tool_usage_accuracy",
"description": "Calls the correct tool with correct parameters. Does not call tools unnecessarily, and does not skip tool calls when they are needed.",
"weight": 6
},
{
"id": "policy_enforcement",
"description": "Enforces business rules: dinner service 17:00-22:00, max party size 8, 30-day booking window. Does not create reservations that violate these constraints.",
"weight": 5
},
{
"id": "information_gathering",
"description": "Collects all required information (date, time, party size, contact) before attempting to create a reservation. Does not ask for information already provided.",
"weight": 4
},
{
"id": "communication_clarity",
"description": "Provides clear, concise responses. Confirms reservation details before finalizing. Uses a professional and helpful tone.",
"weight": 2
},
{
"id": "general_quality",
"description": "Other important quality factors not already covered by the listed criteria.",
"weight": 5,
"always_applicable": true
}
]
}
評価を実行する
品質ルーブリック エバリュエーターはモデル デプロイで実行され、推論コストが発生します。 次のPython例では、重み付けされた 1 ~ 5 ルーブリックを作成し、2 つの予約応答を評価します。
import os
from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import EvaluatorCategory
from azure.identity import DefaultAzureCredential
endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"]
deployment_name = os.environ["MODEL_DEPLOYMENT_NAME"]
evaluator_name = "reservation-quality"
with DefaultAzureCredential() as credential, AIProjectClient(
endpoint=endpoint, credential=credential
) as project:
# 1. Create the rubric evaluator.
evaluator = project.evaluators.create_version(
name=evaluator_name,
evaluator_version={
"name": evaluator_name,
"categories": [EvaluatorCategory.QUALITY],
"display_name": "Reservation quality",
"definition": {
"type": "rubric",
"scoring": {"mode": "likert"},
"pass_threshold": 0.6,
"dimensions": [
{
"id": "intent_recognition",
"description": (
"Identifies the reservation intent (book, "
"modify, or cancel) and follows that workflow."
),
"weight": 9,
},
{
"id": "completeness",
"description": (
"Confirms party size, date, time, and contact "
"details before completing the task."
),
"weight": 6,
},
{
"id": "professional_tone",
"description": "Keeps a polite, professional tone.",
"weight": 3,
},
],
},
},
)
# 2. Create an evaluation that uses the rubric.
openai_client = project.get_openai_client()
eval_obj = openai_client.evals.create(
name="reservation-quality-eval",
data_source_config={
"type": "custom",
"item_schema": {
"type": "object",
"properties": {
"query": {"type": "string"},
"response": {"type": "string"},
},
"required": ["query", "response"],
},
"include_sample_schema": True,
},
testing_criteria=[
{
"type": "azure_ai_evaluator",
"name": evaluator_name,
"evaluator_name": evaluator.name,
"evaluator_version": str(evaluator.version),
"initialization_parameters": {
"deployment_name": deployment_name
},
"data_mapping": {
"query": "{{item.query}}",
"response": "{{item.response}}",
},
}
],
)
# 3. Run the evaluation on inline data.
run = openai_client.evals.runs.create(
eval_id=eval_obj.id,
name="reservation-quality-run",
data_source={
"type": "jsonl",
"source": {
"type": "file_content",
"content": [
{
"item": {
"query": "Can I book a table for 4 at 7 PM?",
"response": (
"You're booked for 4 at 7:00 PM. "
"What's a good contact number?"
),
}
},
{
"item": {
"query": "I need to cancel my Friday reservation.",
"response": "ok",
}
},
],
},
},
)
print(f"Started run {run.id}")
最初の応答が渡されます。 2 つ目は、取り消す予約が確認されないため失敗します。 スコアを表示するには、「 評価結果を取得する」を参照してください。 出力形式は出力 例に示されています。
品質ルーブリックを生成、編集、実行するその他のサンプルについては、 sample_rubric_evaluator_manual.py、 sample_rubric_evaluator_generation_basic.py、 および評価サンプル README を参照してください。
サンプルの出力
エバリュエーターは、各ディメンションの正規化された score、 passed、 threshold、 reason、結果を返します。 スコアは次のように計算されます。
effective_weight_i = weight_i / sum(applicable weights in this row)
contribution_i = effective_weight_i * (raw_score_i - 1) / 4
score = sum(applicable contributions)
rating_1_to_5 = 1 + (4 * score)
アイテムに適用されないディメンションは、スコアに影響しません。 ディメンションが適用されない場合、アイテムは "skipped" され、合格率から除外されます。
{
"status": "completed",
"score": 0.9274193548,
"label": "pass",
"reason": "The verdict is driven most by intent_recognition (5), tool_usage_accuracy (5), and policy_enforcement (5). The assistant correctly identified the booking intent, called the reservation tool with valid parameters (Friday 7:30 PM, party of 4), and returned a clear confirmation with the reservation details.",
"threshold": 0.5,
"passed": true,
"properties": {
"mode": "likert",
"dimension_results": [
{
"id": "intent_recognition",
"raw_score": 5,
"applicable": true,
"weight": 9,
"effective_weight": 0.2903225806,
"contribution": 0.2903225806,
"reason": "The user's request to book a table is correctly identified, and the assistant pursues the booking workflow without unnecessary clarification."
},
{
"id": "tool_usage_accuracy",
"raw_score": 5,
"applicable": true,
"weight": 6,
"effective_weight": 0.1935483871,
"contribution": 0.1935483871,
"reason": "The reservation tool is called once with the correct date, time, and party size parameters derived from the user's request."
},
{
"id": "policy_enforcement",
"raw_score": 5,
"applicable": true,
"weight": 5,
"effective_weight": 0.1612903226,
"contribution": 0.1612903226,
"reason": "The reservation falls within dinner service hours, the party size is within the maximum of 8, and the date is within the 30-day booking window."
},
{
"id": "information_gathering",
"raw_score": 4,
"applicable": true,
"weight": 4,
"effective_weight": 0.1290322581,
"contribution": 0.0967741935,
"reason": "All required information (date, time, party size, contact) is captured from the request without asking for details already provided."
},
{
"id": "communication_clarity",
"raw_score": 5,
"applicable": true,
"weight": 2,
"effective_weight": 0.064516129,
"contribution": 0.064516129,
"reason": "The confirmation is concise and includes the reservation date, time, and party size in a single clear message."
},
{
"id": "general_quality",
"raw_score": 4,
"applicable": true,
"weight": 5,
"effective_weight": 0.1612903226,
"contribution": 0.1209677419,
"reason": "Overall execution is strong: the assistant handles the booking end to end with no unnecessary turns or recovery steps."
}
]
}
}
Note
最上位レベルの scoring オブジェクトなしで作成されたルーブリックは、従来の重み付けされた 1 から 5 のスコアリングとレポート properties.dimension_scoresを保持します。