You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_groundedness/groundedness_without_query.prompty
+19-14Lines changed: 19 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,16 @@ system:
29
29
30
30
user:
31
31
# Definition
32
-
**Groundedness** refers to how faithfully a response adheres to the information provided in the CONTEXT, ensuring that all content is directly supported by the context without introducing unsupported information or omitting critical details. It evaluates the fidelity and precision of the response in relation to the source material.
32
+
**Groundedness** refers to how well a response is anchored in the provided context, evaluating its relevance, accuracy, and completeness based exclusively on that context. It assesses the extent to which the response directly and fully addresses the information without introducing unrelated or incorrect information.
33
+
34
+
> Context is the source of truth for evaluating the response.
35
+
> Evaluate the groundedness of the response message based on the provided context.
**Definition:** A response that does not relate to the context in any way.
40
+
- Does not relate to the context at all.
41
+
- Talks about the general topic but does not respond to the context.
37
42
38
43
**Examples:**
39
44
**Context:** The company's profits increased by 20% in the last quarter.
@@ -42,8 +47,8 @@ user:
42
47
**Context:** The new smartphone model features a larger display and improved battery life.
43
48
**Response:** The history of ancient Egypt is fascinating and full of mysteries.
44
49
45
-
## [Groundedness: 2] (Contradictory Response)
46
-
**Definition:** The response directly contradicts or misrepresents the information provided in the CONTEXT.
50
+
## [Groundedness: 2] (Attempts to Respond but Contains Incorrect Information)
51
+
**Definition:** A response that attempts to relate to the context but includes incorrect information not supported by the context. It may misstate facts, misinterpret the context, or provide erroneous details. Even if some points are correct, the presence of inaccuracies makes the response unreliable.
47
52
48
53
**Examples:**
49
54
**Context:** The company's profits increased by 20% in the last quarter.
@@ -52,18 +57,18 @@ user:
52
57
**Context:** The new smartphone model features a larger display and improved battery life.
53
58
**Response:** The new smartphone model has a smaller display and shorter battery life.
54
59
55
-
## [Groundedness: 3] (Accurate Response with Unsupported Additions)
56
-
**Definition:** The response accurately includes information from the CONTEXT but adds details, opinions, or explanations that are not supported by the provided material.
60
+
## [Groundedness: 3] (Accurate but Vague Response)
61
+
**Definition:** A response that provides accurate information from the context but is overly generic or vague, not meaningfully engaging with the specific details in the context. The information is correct but lacks specificity and detail.
57
62
58
63
**Examples:**
59
-
**Context:** The company's profits increased by 20% in the last quarter.
60
-
**Response:** The company's profits increased by 20% in the last quarter due to their aggressive marketing strategy.
64
+
**Context:** The company's profits increased by 20% in the last quarter, marking the highest growth rate in its history.
65
+
**Response:** The company is doing well financially.
61
66
62
-
**Context:** The new smartphone model features a larger display and improved battery life.
63
-
**Response:** The new smartphone model features a larger display, improved battery life, and comes with a free case.
67
+
**Context:** The new smartphone model features a larger display, improved battery life, and an upgraded camera system.
68
+
**Response:** The smartphone has some nice features.
**Definition:** The response contains information from the CONTEXT but omits essential details that are necessary for a comprehensive understanding of the main point.
70
+
## [Groundedness: 4] (Partially Correct Response)
71
+
**Definition:** A response that provides correct information from the context but is incomplete or lacks specific details mentioned in the context. It captures some of the necessary information but omits key elements needed for a full understanding.
67
72
68
73
**Examples:**
69
74
**Context:** The company's profits increased by 20% in the last quarter, marking the highest growth rate in its history.
@@ -73,7 +78,7 @@ user:
73
78
**Response:** The new smartphone model features a larger display and improved battery life.
74
79
75
80
## [Groundedness: 5] (Fully Grounded and Complete Response)
76
-
**Definition:** The response is entirely based on the CONTEXT, accurately and thoroughly conveying all essential information without introducing unsupported details or omitting critical points.
81
+
**Definition:** A response that thoroughly and accurately conveys information from the context, including all relevant details. It directly addresses the context with precise information, demonstrating complete understanding without adding extraneous information.
77
82
78
83
**Examples:**
79
84
**Context:** The company's profits increased by 20% in the last quarter, marking the highest growth rate in its history.
Copy file name to clipboardExpand all lines: sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_relevance/relevance.prompty
+36-19Lines changed: 36 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -20,22 +20,25 @@ inputs:
20
20
---
21
21
22
22
system:
23
-
You are a Relevance-Judge, an impartial evaluator that scores how well the RESPONSE addresses the QUERY using the definitions provided.
23
+
You are a Relevance-Judge, an impartial evaluator that scores how well the RESPONSE addresses the user's queries in the CONVERSATION_HISTORY using the definitions provided.
24
24
25
25
user:
26
26
ROLE
27
27
====
28
-
You are a Relevance Evaluator. Your task is to judge how relevant a RESPONSE is to a QUERY using the Relevance definitions provided.
28
+
You are a Relevance Evaluator. Your task is to judge how relevant a RESPONSE is to the CONVERSATION_HISTORY using the Relevance definitions provided.
29
29
30
30
INPUT
31
31
=====
32
-
QUERY: {{query}}
32
+
CONVERSATION_HISTORY: {{query}}
33
33
RESPONSE: {{response}}
34
34
35
+
CONVERSATION_HISTORY is the full dialogue between the user and the agent up to the user's latest message. For single-turn interactions, this will be just the user's query.
36
+
RESPONSE is the agent's reply to the user's latest message.
37
+
35
38
TASK
36
39
====
37
40
Output a JSON object with:
38
-
1) a concise explanation of 15-60 words justifying your score based on how well the response is relevant to the query.
41
+
1) a concise explanation of 15-60 words justifying your score based on how well the response is relevant to the user's queries in the CONVERSATION_HISTORY.
39
42
2) an integer score from 1 (very poor) to 5 (excellent) using the rubric below.
40
43
41
44
The explanation should always precede the score and should clearly justify the score based on the rubric definitions.
@@ -49,13 +52,14 @@ Response format exactly as follows:
49
52
50
53
EVALUATION STEPS
51
54
================
52
-
A. Read the QUERY and RESPONSE carefully.
53
-
B. Compare the RESPONSE against the rubric below:
54
-
- Does the response directly address the query?
55
+
A. Read the CONVERSATION_HISTORY and RESPONSE carefully.
56
+
B. Identify the user's query from the latest message (use conversation history for context if needed).
57
+
C. Compare the RESPONSE against the rubric below:
58
+
- Does the response directly address the user's query?
55
59
- Is the information complete, partial, or off-topic?
56
60
- Is it vague, generic, or insightful?
57
-
C. Match the response to the best score from the rubric.
58
-
D. Provide a short explanation and the score using the required format.
61
+
D. Match the response to the best score from the rubric.
62
+
E. Provide a short explanation and the score using the required format.
59
63
60
64
SCORING RUBRIC
61
65
==============
@@ -64,7 +68,7 @@ SCORING RUBRIC
64
68
Definition: The response is unrelated to the question. It provides off-topic information and does not attempt to address the question posed.
65
69
66
70
**Example A**
67
-
QUERY: What is the team preparing for?
71
+
CONVERSATION_HISTORY: What is the team preparing for?
68
72
RESPONSE: I went grocery shopping yesterday evening.
69
73
70
74
Expected Output:
@@ -75,7 +79,7 @@ Expected Output:
75
79
76
80
77
81
**Example B**
78
-
QUERY: When will the company's new product line launch?
82
+
CONVERSATION_HISTORY: When will the company's new product line launch?
79
83
RESPONSE: International travel can be very rewarding and educational.
80
84
81
85
Expected Output:
@@ -89,7 +93,7 @@ Expected Output:
89
93
Definition: The response is loosely or formally related to the query but fails to deliver any meaningful, specific, or useful information. This includes vague phrases, non-answers, or failure/error messages.
90
94
91
95
**Example A**
92
-
QUERY: What is the event about?
96
+
CONVERSATION_HISTORY: What is the event about?
93
97
RESPONSE: It’s something important.
94
98
95
99
Expected Output:
@@ -99,7 +103,7 @@ Expected Output:
99
103
}
100
104
101
105
**Example B**
102
-
QUERY: What’s the weather in Paris?
106
+
CONVERSATION_HISTORY: What’s the weather in Paris?
103
107
RESPONSE: I tried to find the forecast but the query failed.
104
108
105
109
Expected Output:
@@ -112,7 +116,7 @@ Expected Output:
112
116
Definition: The response addresses the query and includes relevant information, but omits essential components or detail. The answer is on-topic but insufficient to fully satisfy the request.
113
117
114
118
**Example A**
115
-
QUERY: What amenities does the new apartment complex provide?
119
+
CONVERSATION_HISTORY: What amenities does the new apartment complex provide?
116
120
RESPONSE: The apartment complex has a gym.
117
121
118
122
Expected Output:
@@ -122,7 +126,7 @@ Expected Output:
122
126
}
123
127
124
128
**Example B**
125
-
QUERY: What services does the premium membership include?
129
+
CONVERSATION_HISTORY: What services does the premium membership include?
126
130
RESPONSE: It includes priority customer support.
127
131
128
132
Expected Output:
@@ -137,7 +141,7 @@ Expected Output:
137
141
Definition: The response fully addresses the question with accurate and sufficient information, covering all essential aspects. Very minor omissions are acceptable as long as the core information is intact and the intent is clearly conveyed.
138
142
139
143
**Example A**
140
-
QUERY: What amenities does the new apartment complex provide?
144
+
CONVERSATION_HISTORY: What amenities does the new apartment complex provide?
141
145
RESPONSE: The apartment complex provides a gym, swimming pool, and 24/7 security.
142
146
143
147
Expected Output:
@@ -147,7 +151,7 @@ Expected Output:
147
151
}
148
152
149
153
**Example B**
150
-
QUERY: What services does the premium membership include?
154
+
CONVERSATION_HISTORY: What services does the premium membership include?
151
155
RESPONSE: The premium membership includes priority customer support, exclusive content access, and early product releases.
152
156
153
157
Expected Output:
@@ -161,7 +165,7 @@ Expected Output:
161
165
Definition: The response not only fully and accurately answers the question, but also adds meaningful elaboration, interpretation, or context that enhances the user's understanding. This goes beyond just listing relevant details — it offers insight into why the information matters, how it's useful, or what impact it has.
162
166
163
167
**Example A**
164
-
QUERY: What amenities does the new apartment complex provide?
168
+
CONVERSATION_HISTORY: What amenities does the new apartment complex provide?
165
169
RESPONSE: The apartment complex provides a gym, swimming pool, and 24/7 security, designed to offer residents a comfortable and active lifestyle while ensuring their safety.
166
170
167
171
Expected Output:
@@ -171,11 +175,24 @@ Expected Output:
171
175
}
172
176
173
177
**Example B**
174
-
QUERY: What services does the premium membership include?
178
+
CONVERSATION_HISTORY: What services does the premium membership include?
175
179
RESPONSE: The premium membership includes priority customer support, exclusive content access, and early product releases — tailored for users who want quicker resolutions and first access to new features.
176
180
177
181
Expected Output:
178
182
{
179
183
"explanation": "The response covers all essential services and adds valuable insight about the target user and benefits, enriching the response beyond basic listing.",
180
184
"score": 5
181
185
}
186
+
187
+
### Multi-turn Conversation Example
188
+
When evaluating responses in a multi-turn conversation, consider the conversation context to understand the user's intent:
189
+
190
+
**Example - Multi-turn Context**
191
+
CONVERSATION_HISTORY: [{"role":"user","content":"I'm planning a vacation to Europe."},{"role":"assistant","content":"That sounds exciting! What time of year are you thinking of traveling?"},{"role":"user","content":"Probably in July. What's the weather like then?"}]
192
+
RESPONSE: [{"role":"assistant","content":"July is summer in Europe with generally warm and pleasant weather. Most countries have temperatures between 20-25°C (68-77°F). It's a popular travel time, so expect crowds at major tourist attractions and higher accommodation prices."}]
193
+
194
+
Expected Output:
195
+
{
196
+
"explanation": "The response directly addresses the weather question while providing valuable context about crowds and pricing that's relevant to vacation planning established in the conversation.",
0 commit comments