Von Bedeutung
この記事で "(プレビュー)" と付記されている項目は、現在、パブリック プレビュー段階です。 このプレビューはサービス レベル アグリーメントなしで提供されており、運用環境ではお勧めしません。 特定の機能はサポート対象ではなく、機能が制限されることがあります。 詳細については、「 Microsoft Azure プレビューの追加使用条件」を参照してください。
エージェントは強力な生産性アシスタントです。 計画、決定、アクションの実行を行うことができます。 エージェントは、通常、 会話でユーザーの意図を使用して最初に理由を指定し、ユーザー要求を呼び出して満たす 適切なツールを選択 し、指示に従って さまざまなタスクを完了 します。
Azure AI エージェントの評価
エージェントはメッセージを出力し、上記の入力を指定するには通常、メッセージの解析と関連情報の抽出が必要です。 Azure AI Agent Service を使用してエージェントを構築している場合は、エージェント メッセージを直接受け取る評価のためのネイティブ統合が提供されます。 詳細については、 Azure AI Agent Service でエージェントを評価するエンド ツー エンドの例を参照してください。
IntentResolution
、ToolCallAccuracy
、エージェントワークフローに固有のTaskAdherence
に加えて、他の品質とエージェントワークフローの安全性の側面を評価し、組み込みのエバリュエーターの包括的なスイートを活用することもできます。 コンバーターからの Azure AI エージェント メッセージのエバリュエーターの一覧をサポートします。
-
品質:
IntentResolution
、ToolCallAccuracy
、TaskAdherence
、Relevance
、Coherence
、Fluency
-
安全性:
CodeVulnerabilities
、Violence
、Self-harm
、Sexual
、HateUnfairness
、IndirectAttack
、ProtectedMaterials
。
ここでは、 IntentResolution
、 ToolCallAccuracy
、 TaskAdherence
の例を示します。 Azure AI エージェント メッセージのサポートを使用した他のエバリュエーターの Azure AI エージェントの評価 の例を参照してください。
AI 支援エバリュエーターのモデル構成
次のコード スニペットで参照するために、AI 支援エバリュエーターは LLM ジャッジのモデル構成を使用します。
import os
from azure.ai.evaluation import AzureOpenAIModelConfiguration
from dotenv import load_dotenv
load_dotenv()
model_config = AzureOpenAIModelConfiguration(
azure_endpoint=os.environ["AZURE_ENDPOINT"],
api_key=os.environ.get["AZURE_API_KEY"],
azure_deployment=os.environ.get("AZURE_DEPLOYMENT_NAME"),
api_version=os.environ.get("AZURE_API_VERSION"),
)
ヒント
推論機能とコスト効率のバランスを取るための o3-mini
を使用することをお勧めします。
意図の解決
IntentResolutionEvaluator
は、システムがユーザーの要求をどの程度識別して理解しているかを測定します。これには、ユーザーの意図の範囲の指定、質問の明確化、エンド ユーザーの機能の範囲の通知などが含まれます。 スコアが高いほど、ユーザーの意図をより適切に識別できます。
意図解決の例
from azure.ai.evaluation import IntentResolutionEvaluator
intent_resolution = IntentResolutionEvaluator(model_config=model_config, threshold=3)
intent_resolution(
query="What are the opening hours of the Eiffel Tower?",
response="Opening hours of the Eiffel Tower are 9:00 AM to 11:00 PM."
)
意図解決の出力
likert スケール (整数 1 から 5) の数値スコアと、より高いスコアの方が優れています。 数値のしきい値 (既定値は 3) を指定すると、スコア >= しきい値の場合は "pass" を出力し、それ以外の場合は "fail" も出力します。 理由と追加のフィールドを使用すると、スコアが高いか低いかを理解するのに役立ちます。
{
"intent_resolution": 5.0,
"intent_resolution_result": "pass",
"intent_resolution_threshold": 3,
"intent_resolution_reason": "The response provides the opening hours of the Eiffel Tower clearly and accurately, directly addressing the user's query. It includes specific times, which fully resolves the user's request for information about the opening hours.",
"additional_details": {
"conversation_has_intent": True,
"agent_perceived_intent": "inquire about opening hours",
"actual_user_intent": "find out the opening hours of the Eiffel Tower",
"correct_intent_detected": True,
"intent_resolved": True
}
}
Azure AI Agent Serice の外部でエージェントを構築している場合、このエバリュエーターはエージェント メッセージに一般的なスキーマを受け入れます。 詳細については、 意図の解決に関するサンプル ノートブックを参照してください。
ツール呼び出しの精度
ToolCallAccuracyEvaluator
は、エージェントワークフローの前のステップから適切なツールを選択し、正しいパラメーターを抽出して処理するエージェントの能力を測定します。 これは、行われた各ツール呼び出しが正確 (バイナリ) であるかどうかを検出し、平均スコアを報告します。これは、行われたツール呼び出し全体の合格率として解釈できます。
注
ToolCallAccuracyEvaluator
は Azure AI エージェントの関数ツールの評価のみをサポートしますが、組み込みのツール評価はサポートしていません。 エージェント メッセージの評価には、少なくとも 1 つの Function Tool が実際に呼び出されている必要があります。
ツール呼び出し精度の例
from azure.ai.evaluation import ToolCallAccuracyEvaluator
tool_call_accuracy = ToolCallAccuracyEvaluator(model_config=model_config, threshold=3)
tool_call_accuracy(
query="How is the weather in Seattle?",
tool_calls=[{
"type": "tool_call",
"tool_call_id": "call_CUdbkBfvVBla2YP3p24uhElJ",
"name": "fetch_weather",
"arguments": {
"___location": "Seattle"
}
}],
tool_definitions=[{
"id": "fetch_weather",
"name": "fetch_weather",
"description": "Fetches the weather information for the specified ___location.",
"parameters": {
"type": "object",
"properties": {
"___location": {
"type": "string",
"description": "The ___location to fetch weather for."
}
}
}
}
]
)
ツール呼び出し精度の出力
数値スコア (正しいツール呼び出しの合格率) は 0 から 1 で、スコアが高いほど良くなります。 数値のしきい値 (既定値は 3) を指定すると、スコア >= しきい値の場合は "pass" を出力し、それ以外の場合は "fail" も出力します。 理由とツール呼び出しの詳細フィールドを使用すると、スコアが高いか低いかを理解するのに役立ちます。
{
"tool_call_accuracy": 1.0,
"tool_call_accuracy_result": "pass",
"tool_call_accuracy_threshold": 0.8,
"per_tool_call_details": [
{
"tool_call_accurate": True,
"tool_call_accurate_reason": "The input Data should get a Score of 1 because the TOOL CALL is directly relevant to the user's question about the weather in Seattle, includes appropriate parameters that match the TOOL DEFINITION, and the parameter values are correct and relevant to the user's query.",
"tool_call_id": "call_CUdbkBfvVBla2YP3p24uhElJ"
}
]
}
Azure AI エージェント サービスの外部でエージェントを構築している場合、このエバリュエーターはエージェント メッセージに一般的なスキーマを受け入れます。 詳細については、 ツール呼び出し精度のサンプル ノートブックを参照してください。
タスクの準拠
エージェント システムなどのさまざまなタスク指向の AI システムでは、非効率的な手順や範囲外の手順を実行するのではなく、特定のタスクを完了するためにエージェントが追跡を続けたかどうかを評価することが重要です。
TaskAdherenceEvaluator
は、エージェントのタスク命令 (システム メッセージとユーザー クエリから抽出) と使用可能なツールに従って、エージェントの応答が割り当てられたタスクにどの程度準拠しているかを測定します。 スコアが高いほど、特定のタスクを解決するためのシステム命令の準拠性が向上します。
タスクの準拠の例
from azure.ai.evaluation import TaskAdherenceEvaluator
task_adherence = TaskAdherenceEvaluator(model_config=model_config, threshold=3)
task_adherence(
query="What are the best practices for maintaining a healthy rose garden during the summer?",
response="Make sure to water your roses regularly and trim them occasionally."
)
タスクの準拠の出力
likert スケール (整数 1 から 5) の数値スコアと、より高いスコアの方が優れています。 数値のしきい値 (既定値は 3) を指定すると、スコア >= しきい値の場合は "pass" を出力し、それ以外の場合は "fail" も出力します。 理由フィールドを使用すると、スコアが高いか低いかを理解するのに役立ちます。
{
"task_adherence": 2.0,
"task_adherence_result": "fail",
"task_adherence_threshold": 3,
"task_adherence_reason": "The response partially addresses the query by mentioning relevant practices but lacks critical details and depth, making it insufficient for a comprehensive understanding of maintaining a rose garden in summer."
}
Azure AI エージェント サービスの外部でエージェントを構築している場合、このエバリュエーターはエージェント メッセージに一般的なスキーマを受け入れます。 詳細については、 タスクの準拠に関するサンプル ノートブックを参照してください。