Skip to content

Commit 0989a0e

Browse files
committed
add groundedness
1 parent e37fab5 commit 0989a0e

File tree

1 file changed

+52
-14
lines changed

1 file changed

+52
-14
lines changed

articles/ai-services/openai/concepts/content-filter.md

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ Text and image models support Drugs as an additional classification. This catego
4343
| Sexual | Sexual describes language related to anatomical organs and genitals, romantic relationships and sexual acts, acts portrayed in erotic or affectionate terms, including those portrayed as an assault or a forced sexual violent act against one’s will. <br><br> This includes but is not limited to:<ul><li>Vulgar content</li><li>Prostitution</li><li>Nudity and Pornography</li><li>Abuse</li><li>Child exploitation, child abuse, child grooming</li></ul> |
4444
| Violence | Violence describes language related to physical actions intended to hurt, injure, damage, or kill someone or something; describes weapons, guns and related entities. <br><br>This includes, but isn't limited to: <ul><li>Weapons</li><li>Bullying and intimidation</li><li>Terrorist and violent extremism</li><li>Stalking</li></ul> |
4545
| Self-Harm | Self-harm describes language related to physical actions intended to purposely hurt, injure, damage one’s body or kill oneself. <br><br> This includes, but isn't limited to: <ul><li>Eating Disorders</li><li>Bullying and intimidation</li></ul> |
46-
| Protected Material for Text<sup>*</sup> | Protected material text describes known text content (for example, song lyrics, articles, recipes, and selected web content) that can be outputted by large language models.
46+
| Protected Material for Text<sup>1</sup> | Protected material text describes known text content (for example, song lyrics, articles, recipes, and selected web content) that can be outputted by large language models.
4747
| Protected Material for Code | Protected material code describes source code that matches a set of source code from public repositories, which can be outputted by large language models without proper citation of source repositories.
4848
|User Prompt Attacks |User prompt attacks are User Prompts designed to provoke the Generative AI model into exhibiting behaviors it was trained to avoid or to break the rules set in the System Message. Such attacks can vary from intricate roleplay to subtle subversion of the safety objective. |
4949
|Indirect Attacks |Indirect Attacks, also referred to as Indirect Prompt Attacks or Cross-Domain Prompt Injection Attacks, are a potential vulnerability where third parties place malicious instructions inside of documents that the Generative AI system can access and process. Requires [document embedding and formatting](#embedding-documents-in-your-prompt). |
50+
| Groundedness<sup>2</sup> | Groundedness detection flags whether the text responses of large language models (LLMs) are grounded in the source materials provided by the users. Ungrounded material refers to instances where the LLMs produce information that is non-factual or inaccurate from what was present in the source materials. Requires [document embedding and formatting](#embedding-documents-in-your-prompt). |
5051

51-
<sup>*</sup> If you're an owner of text material and want to submit text content for protection, [file a request](https://aka.ms/protectedmaterialsform).
52+
<sup>1</sup> If you're an owner of text material and want to submit text content for protection, [file a request](https://aka.ms/protectedmaterialsform).
5253

54+
<sup>2</sup> Not available in non-streaming scenarios; only available for streaming scenarios. The following regions support Groundedness Detection: Central US, East US, France Central, and Canada East
5355

5456
[!INCLUDE [severity-levels text, four-level](../../content-safety/includes/severity-levels-text-four.md)]
5557

@@ -328,24 +330,27 @@ When annotations are enabled as shown in the code snippets below, the following
328330
|indirect attacks|detected (true or false), </br>filtered (true or false)|
329331
|protected material text|detected (true or false), </br>filtered (true or false)|
330332
|protected material code|detected (true or false), </br>filtered (true or false), </br>Example citation of public GitHub repository where code snippet was found, </br>The license of the repository|
333+
|Groundedness | detected (true or false)</br>filtered (true or false) </br>details (`completion_end_offset`, `completion_start_offset`) |
331334

332335
When displaying code in your application, we strongly recommend that the application also displays the example citation from the annotations. Compliance with the cited license may also be required for Customer Copyright Commitment coverage.
333336

334337
See the following table for the annotation availability in each API version:
335338

336-
|Category |2024-02-01 GA| 2024-04-01-preview | 2023-10-01-preview | 2023-06-01-preview|
339+
|Category |2024-10-01-preview|2024-02-01 GA| 2024-04-01-preview | 2023-10-01-preview | 2023-06-01-preview|
337340
|--|--|--|--|
338-
| Hate |||||
339-
| Violence |||||
340-
| Sexual |||||
341-
| Self-harm |||||
342-
| Prompt Shield for user prompt attacks|||||
343-
|Prompt Shield for indirect attacks| || | |
344-
|Protected material text|||||
345-
|Protected material code|||||
346-
|Profanity blocklist|||||
347-
|Custom blocklist| ||||
348-
341+
| Hate ||||||
342+
| Violence ||||||
343+
| Sexual ||||||
344+
| Self-harm ||||||
345+
| Prompt Shield for user prompt attacks||||||
346+
|Prompt Shield for indirect attacks| | || | |
347+
|Protected material text||||||
348+
|Protected material code||||||
349+
|Profanity blocklist||||||
350+
|Custom blocklist|| ||||
351+
|Groundedness<sup>1</sup>|| | | | |
352+
353+
<sup>1</sup> Not available in non-streaming scenarios; only available for streaming scenarios. The following regions support Groundedness Detection: Central US, East US, France Central, and Canada East
349354

350355
# [OpenAI Python 1.x](#tab/python-new)
351356

@@ -710,6 +715,39 @@ violence : @{filtered=False; severity=safe}
710715
711716
For details on the inference REST API endpoints for Azure OpenAI and how to create Chat and Completions, follow [Azure OpenAI Service REST API reference guidance](../reference.md). Annotations are returned for all scenarios when using any preview API version starting from `2023-06-01-preview`, as well as the GA API version `2024-02-01`.
712717
718+
### Groundedness
719+
720+
#### Annotate only
721+
722+
Returns offsets referencing the ungrounded completion content.
723+
724+
```json
725+
{
726+
  "ungrounded_material": {
727+
"details": [
728+
{
729+
"completion_end_offset": 127,
730+
"completion_start_offset": 27
731+
}
732+
],
733+
"detected": true,
734+
"filtered": false
735+
}
736+
}
737+
```
738+
739+
#### Annotate and filter
740+
741+
Blocks completion content when ungrounded completion content was detected.
742+
743+
```json
744+
{ "ungrounded_material": {
745+
"detected": true,
746+
"filtered": true
747+
}
748+
}
749+
```
750+
713751
### Example scenario: An input prompt containing content that is classified at a filtered category and severity level is sent to the completions API
714752
715753
```json

0 commit comments

Comments
 (0)