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: articles/ai-services/content-safety/quickstart-groundedness.md
+26-47Lines changed: 26 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,32 +134,21 @@ The parameters in the request body are defined in this table:
134
134
|-`query`| (Optional) This represents the question in a QnA task. Character limit: 7,500. | String |
135
135
|**text**| (Required) The LLM output text to be checked. Character limit: 7,500. | String |
136
136
|**groundingSources**| (Required) Uses an array of grounding sources to validate AI-generated text. Up to 55,000 characters of grounding sources can be analyzed in a single request. | String array |
137
-
|**reasoning**| (Optional) Specifies whether to use the reasoning feature. The default value is`false`. If `true`, the service uses Azure OpenAI resources to provide an explanation. Be careful: using reasoning increases the processing time and incurs extra fees.| Boolean |
137
+
|**reasoning**| (Optional) Specifies whether to use the reasoning feature. The default value is`false`. If `true`, you need to bring your own Azure OpenAI resources to provide an explanation. Be careful: using reasoning increases the processing time and incurs extra fees.| Boolean |
138
138
139
139
### Interpret the API response
140
140
141
141
After you submit your request, you'll receive a JSON response reflecting the Groundedness analysis performed. Here’s what a typical output looks like:
142
142
143
143
```json
144
144
{
145
-
"ungrounded": true,
146
-
"confidenceScore": 1,
147
-
"ungroundedPercentage": 1,
148
-
"ungroundedDetails": [
149
-
{
150
-
"text": "string",
151
-
"offset": {
152
-
"utf8": 0,
153
-
"utf16": 0,
154
-
"codePoint": 0
155
-
},
156
-
"length": {
157
-
"utf8": 0,
158
-
"utf16": 0,
159
-
"codePoint": 0
160
-
}
161
-
}
162
-
]
145
+
"ungroundedDetected": true,
146
+
"ungroundedPercentage": 1,
147
+
"ungroundedDetails": [
148
+
{
149
+
"text": "12/hour."
150
+
}
151
+
]
163
152
}
164
153
```
165
154
@@ -172,15 +161,6 @@ The JSON objects in the output are defined here:
172
161
|**ungroundedPercentage**| Specifies the proportion of the text identified as ungrounded, expressed as a number between 0 and 1, where 0 indicates no ungrounded content and 1 indicates entirely ungrounded content.| Float |
173
162
|**ungroundedDetails**| Provides insights into ungrounded content with specific examples and percentages.| Array |
174
163
| -**`Text`**| The specific text that is ungrounded. | String |
175
-
| -**`offset`**| An object describing the position of the ungrounded text in various encoding. | String |
176
-
| - `offset > utf8`| The offset position of the ungrounded text in UTF-8 encoding. | Integer |
177
-
| - `offset > utf16`| The offset position of the ungrounded text in UTF-16 encoding. | Integer |
178
-
| - `offset > codePoint`| The offset position of the ungrounded text in terms of Unicode code points. |Integer |
179
-
| -**`length`**| An object describing the length of the ungrounded text in various encoding. (utf8, utf16, codePoint), similar to the offset. | Object |
180
-
| - `length > utf8`| The length of the ungrounded text in UTF-8 encoding. | Integer |
181
-
| - `length > utf16`| The length of the ungrounded text in UTF-16 encoding. | Integer |
182
-
| - `length > codePoint`| The length of the ungrounded text in terms of Unicode code points. |Integer |
183
-
184
164
185
165
## Check groundedness with reasoning
186
166
@@ -326,25 +306,24 @@ After you submit your request, you'll receive a JSON response reflecting the Gro
326
306
327
307
```json
328
308
{
329
-
"ungrounded": true,
330
-
"confidenceScore": 1,
331
-
"ungroundedPercentage": 1,
332
-
"ungroundedDetails": [
333
-
{
334
-
"text": "string",
335
-
"offset": {
336
-
"utf8": 0,
337
-
"utf16": 0,
338
-
"codePoint": 0
339
-
},
340
-
"length": {
341
-
"utf8": 0,
342
-
"utf16": 0,
343
-
"codePoint": 0
344
-
},
345
-
"reason": "string"
346
-
}
347
-
]
309
+
"ungroundedDetected": true,
310
+
"ungroundedPercentage": 1,
311
+
"ungroundedDetails": [
312
+
{
313
+
"text": "12/hour.",
314
+
"offset": {
315
+
"utF8": 0,
316
+
"utF16": 0,
317
+
"codePoint": 0
318
+
},
319
+
"length": {
320
+
"utF8": 8,
321
+
"utF16": 8,
322
+
"codePoint": 8
323
+
},
324
+
"reason": "None. The premise mentions a pay of \"10/hour\" but does not mention \"12/hour.\" It's neutral. "
0 commit comments