Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build and deploy AI applications on Azure AI Foundry using Microsoft's model catalog and AI services
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
foundry-agent/trace/references/eval-correlation.md
1# Eval Correlation — Find Evaluation Results by Response or Conversation ID23Look up evaluation scores for a specific agent response using App Insights.45> **IMPORTANT:** The Foundry evaluation API does NOT support querying by response ID or conversation ID. App Insights `customEvents` is the ONLY way to correlate eval scores to specific responses. Always use this KQL approach when the user asks for eval results for a specific response or conversation.67## Prerequisites89- App Insights resource resolved (see [trace.md](../trace.md) Before Starting)10- A response ID (`gen_ai.response.id`) or conversation ID (`gen_ai.conversation.id`) from a previous trace query1112## Search by Response ID1314```kql15customEvents16| where timestamp > ago(30d)17| where name == "gen_ai.evaluation.result"18| where customDimensions["gen_ai.response.id"] == "<response_id>"19| extend20evalName = tostring(customDimensions["gen_ai.evaluation.name"]),21score = todouble(customDimensions["gen_ai.evaluation.score.value"]),22label = tostring(customDimensions["gen_ai.evaluation.score.label"]),23explanation = tostring(customDimensions["gen_ai.evaluation.explanation"]),24responseId = tostring(customDimensions["gen_ai.response.id"]),25conversationId = tostring(customDimensions["gen_ai.conversation.id"])26| project timestamp, evalName, score, label, explanation, responseId, conversationId27| order by evalName asc28```2930## Search by Conversation ID3132```kql33customEvents34| where timestamp > ago(30d)35| where name == "gen_ai.evaluation.result"36| where customDimensions["gen_ai.conversation.id"] == "<conversation_id>"37| extend38evalName = tostring(customDimensions["gen_ai.evaluation.name"]),39score = todouble(customDimensions["gen_ai.evaluation.score.value"]),40label = tostring(customDimensions["gen_ai.evaluation.score.label"]),41explanation = tostring(customDimensions["gen_ai.evaluation.explanation"]),42responseId = tostring(customDimensions["gen_ai.response.id"])43| project timestamp, evalName, score, label, explanation, responseId44| order by responseId asc, evalName asc45```4647## Present Results4849Show eval scores as a table:5051| Evaluator | Score | Label | Explanation |52|-----------|-------|-------|-------------|53| coherence | 5.0 | pass | Response is well-structured... |54| fluency | 4.0 | pass | Natural language flow... |55| relevance | 2.0 | fail | Response doesn't address... |5657When showing alongside a span tree (see [Conversation Detail](conversation-detail.md)), attach eval scores to the span whose `gen_ai.response.id` matches.58