에이전트 평가자 (미리보기) (클래식)

현재 보기:Foundry(클래식) 포털 버전 - 새 Foundry 포털의 버전으로 전환

Note

평가 및 Foundry 포털용 Microsoft Foundry SDK는 공개 미리 보기로 제공되지만 API는 일반적으로 모델 및 데이터 세트 평가에 사용할 수 있습니다(에이전트 평가는 공개 미리 보기로 유지됨). 이 문서에서 표시된 Azure AI 평가 SDK 및 평가자는 현재 모든 곳에서 공개 미리 보기로 제공됩니다.

에이전트는 강력한 생산성 보조자입니다. 그들은 계획을 세우고, 결정을 내리며, 행동을 실행합니다. 상담원은 일반적으로 대화에서 사용자의 의도를 추론하고, 사용자 요청을 충족시키기 위한 적절한 도구를 선택 하며, 지시에 따라 작업을 완료 합니다. Microsoft Foundry는 에이전트 워크플로우를 위한 다음과 같은 에이전트별 평가기를 지원합니다:

Evaluating Azure AI agents

에이전트는 메시지를 보내며, 입력을 제공하려면 관련 정보를 추출하기 위해 이 메시지를 파싱해야 하는 경우가 많습니다. Azure AI Agent Service를 사용해 에이전트를 구축한다면, 이 서비스는 평가를 위한 네이티브 통합을 제공하며 에이전트 메시지를 직접 가져갑니다. 예를 들어, 'AI 에이전트 평가'를 참조하세요.

에이전트 워크플로우에 특화된 , 외IntentResolutionToolCallAccuracyTaskAdherence에도, 포괄적인 내장 평가기 모음을 통해 이러한 워크플로우의 다른 품질 및 안전성 측면도 평가할 수 있습니다. Foundry는 변환기에서 제공하는 Azure AI 에이전트 메시지 평가자 목록을 지원합니다:

  • 품질: IntentResolution, ToolCallAccuracy, TaskAdherence, Relevance, Coherence, 그리고 Fluency
  • 안전성: CodeVulnerabilities, Violence, Self-harm, SexualHateUnfairness, , IndirectAttack, 그리고ProtectedMaterials

이 글에는 , IntentResolutionToolCallAccuracy, , 의 TaskAdherence예시가 포함되어 있습니다. Azure AI 에이전트 메시지를 가진 다른 평가자들의 예시는 평가 Azure AI 에이전트를 참조하세요.

AI 지원 평가자를 위한 모델 구성

참고로, 다음 코드 스니펫에서 AI 지원 평가자는 대형 언어 모델 저지(LLM-judge)에 대한 모델 구성을 사용합니다:

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"),
)

평가자 모델 지원

Azure AI 에이전트 서비스는 평가자에 따라 AzureOpenAI 또는 OpenAI 추론 모델 및 LLM 심사위원을 위한 비추론 모델을 지원합니다:

Evaluators 심사관으로서의 추론 모델 (예: Azure OpenAI / OpenAI의 o-시리즈 모델) 비추론 모델(예: gpt-4.1 또는 gpt-4o) To enable
IntentResolution, TaskAdherence, ToolCallAccuracy, ResponseCompleteness, Coherence, Fluency, SimilarityGroundedness, RetrievalRelevance Supported Supported 평가기를 초기화할 때 추가 매개변수를 설정하세요 is_reasoning_model=True
Other evaluators Not Supported Supported --

정교한 추론이 필요한 복잡한 평가의 경우, 추론 성능과 비용 효율성의 균형을 맞춘 강력한 추론 모델을 4.1-mini 사용하세요.

Intent resolution

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."
)

의도 해상도 출력

수치 점수는 리커트 척도(정수 1에서 5까지)를 사용하며, 점수가 높을수록 더 좋습니다. 수치 임계값(기본값은 3)이 주어지면, 점수가 임계값 이상일 경우 평가자는 통과 로 간주되며, 그렇지 않으면 실패 합니다. 이유와 다른 필드를 사용하면 점수가 높거나 낮은 이유를 이해하는 데 도움이 됩니다.

{
    "intent_resolution": 5,
    "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.",
}

Foundry Agent Service 외부에서 에이전트를 구축하면, 이 평가자는 에이전트 메시지에 일반적인 스키마를 수용합니다. 샘플 노트북을 탐색하려면 의도 해결(Intent Resolution)을 참조하세요.

공구 호출 정확도

ToolCallAccuracyEvaluator 실행 중 에이전트가 도구 호출을 하는 정확도와 효율성을 측정합니다. 점수는 다음을 기반으로 1에서 5까지 제공합니다:

  • 사용된 도구의 관련성과 유용성에 대해
  • 도구 호출에 사용되는 매개변수의 정확성
  • 누락 또는 과도한 통화 횟수

도구 호출 평가 지원

ToolCallAccuracyEvaluator 에이전트 서비스에서 다음 도구들에 대한 평가를 지원합니다:

  • File Search
  • Azure AI 검색
  • Bing Grounding
  • Bing Custom Search
  • SharePoint Grounding
  • Code Interpreter
  • Fabric 데이터 에이전트
  • OpenAPI
  • 함수 도구(사용자 정의 도구)

에이전트 실행에서 지원되지 않는 도구가 사용되면, 평가자는 패스 를 출력하며 해당 도구를 평가하는 것이 지원되지 않는다고 설명합니다. 이 접근법은 이러한 사례를 쉽게 걸러낼 수 있게 해줍니다. 평가를 가능하게 하기 위해 지원되지 않는 도구를 사용자 정의 도구로 랩핑할 것을 권장합니다.

공구 호출 정확도 예시

from azure.ai.evaluation import ToolCallAccuracyEvaluator

tool_call_accuracy = ToolCallAccuracyEvaluator(model_config=model_config, threshold=3)

# provide the agent response with tool calls 
tool_call_accuracy(
    query="What timezone corresponds to 41.8781,-87.6298?",
    response=[
    {
        "createdAt": "2025-04-25T23:55:52Z",
        "run_id": "run_DmnhUGqYd1vCBolcjjODVitB",
        "role": "assistant",
        "content": [
            {
                "type": "tool_call",
                "tool_call_id": "call_qi2ug31JqzDuLy7zF5uiMbGU",
                "name": "azure_maps_timezone",
                "arguments": {
                    "lat": 41.878100000000003,
                    "lon": -87.629800000000003
                }
            }
        ]
    },    
    {
        "createdAt": "2025-04-25T23:55:54Z",
        "run_id": "run_DmnhUGqYd1vCBolcjjODVitB",
        "tool_call_id": "call_qi2ug31JqzDuLy7zF5uiMbGU",
        "role": "tool",
        "content": [
            {
                "type": "tool_result",
                "tool_result": {
                    "ianaId": "America/Chicago",
                    "utcOffset": None,
                    "abbreviation": None,
                    "isDaylightSavingTime": None
                }
            }
        ]
    },
    {
        "createdAt": "2025-04-25T23:55:55Z",
        "run_id": "run_DmnhUGqYd1vCBolcjjODVitB",
        "role": "assistant",
        "content": [
            {
                "type": "text",
                "text": "The timezone for the coordinates 41.8781, -87.6298 is America/Chicago."
            }
        ]
    }
    ],   
    tool_definitions=[
                {
                    "name": "azure_maps_timezone",
                    "description": "local time zone information for a given latitude and longitude.",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "lat": {
                                "type": "float",
                                "description": "The latitude of the location."
                            },
                            "lon": {
                                "type": "float",
                                "description": "The longitude of the location."
                            }
                        }
                    }
                }
    ]
)

# alternatively, provide the tool calls directly without the full agent response
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."
                            }
                        }
                    }
                }
    ]
)

공구 호출 정확도 출력

수치 점수는 리커트 척도(정수 1부터 5까지)로 나뉩니다. 점수가 높을수록 더 좋습니다. 수치 임계값(기본값은 3)이 주어지면, 점수 >= 임계값이면 평가자는 통과를 출력하고, 그렇지 않으면 실패합니다. 이유와 도구 호출 상세 필드를 활용해 점수가 높거나 낮은 이유를 파악하세요.

{
    "tool_call_accuracy": 5,
    "tool_call_accuracy_result": "pass",
    "tool_call_accuracy_threshold": 3,
    "details": {
        "tool_calls_made_by_agent": 1,
        "correct_tool_calls_made_by_agent": 1,
        "per_tool_call_details": [
            {
                "tool_name": "fetch_weather",
                "total_calls_required": 1,
                "correct_calls_made_by_agent": 1,
                "correct_tool_percentage": 100%,
                "tool_call_errors": 0,
                "tool_call_success_result": "pass"
            }
        ],
        "excess_tool_calls": {
            "total": 0,
            "details": []
        },
        "missing_tool_calls": {
            "total": 0,
            "details": []
        }
    }
}

Azure AI 에이전트 서비스 외부에서 에이전트를 구축한다면, 이 평가자는 에이전트 메시지에 일반적인 스키마를 받아들입니다. 샘플 노트북은 Tool Call Accuracy를 참조하세요.

Task adherence

에이전트 시스템과 같은 다양한 작업 지향 AI 시스템에서는 에이전트가 비효율적이거나 범위를 벗어난 조치를 취하지 않고 작업을 완수하는지 평가하는 것이 중요합니다. TaskAdherenceEvaluator 에이전트의 응답이 할당된 작업에 얼마나 잘 부합하는지, 작업 지침과 사용 가능한 도구에 따라 측정합니다. 작업 명령어는 시스템 메시지와 사용자 쿼리에서 추출됩니다. 점수가 높을수록 작업 해결을 위한 시스템 지시를 더 잘 준수하고 있음을 나타냅니다.

과제 준수 예시

from azure.ai.evaluation import TaskAdherenceEvaluator

task_adherence = TaskAdherenceEvaluator(model_config=model_config)
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."                         
)

과제 준수 출력

평가기는 그렇지 않으면 합격 또는 불합 격을 출력합니다. 점수의 이유를 이해하려면 이유 필드를 사용하세요

{
    "task_adherence_result": "fail",
    "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 Agent Service 외부에서 에이전트를 구축한다면, 이 평가자는 에이전트 메시지에 일반적인 스키마를 수용합니다. 샘플 노트북은 ' 과제 준수'를 참조하세요.