Skip to content

Commit e46b4ad

Browse files
authored
Merge pull request #1721 from PatrickFarley/openai-updates
combine dup instructions
2 parents 00fe4aa + 7b8166e commit e46b4ad

File tree

6 files changed

+78
-87
lines changed

6 files changed

+78
-87
lines changed

articles/ai-services/openai/how-to/content-filters.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -43,40 +43,7 @@ You can configure the following filter categories in addition to the default har
4343
| Protected material - text | GA| On | Completion | Identifies and blocks known text content from being displayed in the model output (for example, song lyrics, recipes, and selected web content). |
4444
| Groundedness* | Preview |Off | Completion |Detects whether the text responses of large language models (LLMs) are grounded in the source materials provided by the users. Ungroundedness 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](/azure/ai-services/openai/concepts/content-filter?tabs=warning%2Cuser-prompt%2Cpython-new#embedding-documents-in-your-prompt).|
4545

46-
47-
48-
## Configure content filters with Azure AI Foundry
49-
50-
The following steps show how to set up a customized content filtering configuration for your Azure OpenAI resource within AI Foundry portal. For guidance with content filters in your Azure AI Foundry project, you can read more at [Azure AI Foundry content filtering](/azure/ai-studio/concepts/content-filtering).
51-
52-
1. Go to Azure AI Foundry and navigate to the **Safety + security** page on the left menu.
53-
1. Proceed to the **Content filters** tab and create a new customized content filtering configuration.
54-
55-
This leads to the following configuration view, where you can choose a name for the custom content filtering configuration. After entering a name, you can configure the **input filters** (for user prompts) and **output filters** (for model completion).
56-
57-
:::image type="content" source="../media/content-filters/input-filter.png" alt-text="Screenshot of input filter screen.":::
58-
59-
:::image type="content" source="../media/content-filters/output-filter.png" alt-text="Screenshot of output filter screen.":::
60-
61-
For the first four content categories there are three severity levels that are configurable: Low, medium, and high. You can use the sliders to set the severity threshold if you determine that your application or usage scenario requires different filtering than the default values.
62-
63-
Some filters, such as Prompt Shields and Protected material detection, enable you to determine if the model should annotate and/or block content. Selecting **Annotate only** runs the respective model and return annotations via API response, but it will not filter content. In addition to annotate, you can also choose to block content.
64-
65-
If your use case was approved for modified content filters, you receive full control over content filtering configurations and can choose to turn filtering partially or fully off, or enable annotate only for the content harms categories (violence, hate, sexual and self-harm).
66-
67-
68-
1. You can create multiple content filtering configurations as per your requirements.
69-
70-
:::image type="content" source="../media/content-filters/multiple.png" alt-text="Screenshot of multiple content configurations in the Azure portal." lightbox="../media/content-filters/multiple.png":::
71-
72-
1. Next, to use a custom content filtering configuration, assign it to one or more deployments in your resource. To do this, go to the **Deployments** tab and select your deployment. Then select **Edit**.
73-
1. In the **Update deployment** window that appears, select your custom filter from the **Content filter** dropdown menu. Then select **Save and close** to apply the selected configuration to the deployment.
74-
75-
:::image type="content" source="../media/content-filters/select-filter.png" alt-text="Screenshot of edit deployment configuration with content filter selected." lightbox="../media/content-filters/select-filter.png":::
76-
77-
You can also edit and delete a content filter configuration if required.
78-
79-
Before you delete a content filtering configuration, you will need to unassign and replace it from any deployment in the **Deployments** tab.
46+
[!INCLUDE [create-content-filter](../../../ai-studio/includes/create-content-filter.md)]
8047

8148
## Report content filtering feedback
8249

articles/ai-studio/concepts/content-filtering.md

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -69,59 +69,7 @@ You can also enable the following special output filters:
6969
- 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.
7070
- Groundedness: The groundedness detection filter detects whether the text responses of large language models (LLMs) are grounded in the source materials provided by the users.
7171

72-
## Create a content filter
73-
74-
For any model deployment in [Azure AI Foundry](https://ai.azure.com), you can directly use the default content filter, but you might want to have more control. For example, you could make a filter stricter or more lenient, or enable more advanced capabilities like prompt shields and protected material detection.
75-
76-
Follow these steps to create a content filter:
77-
78-
1. Go to AI Foundry and navigate to your project/ hub. Then select the Safety+ Security tab on the left nav and select the Content Filters.
79-
:::image type="content" source="../media/content-safety/content-filter/create-content-filter.png" alt-text="Screenshot of the button to create a new content filter." lightbox="../media/content-safety/content-filter/create-content-filter.png":::
80-
81-
1. On the **Basic information** page, enter a name for your content filter. Select a connection to associate with the content filter. Then select **Next**.
82-
83-
:::image type="content" source="../media/content-safety/content-filter/create-content-filter-basic.png" alt-text="Screenshot of the option to select or enter basic information such as the filter name when creating a content filter." lightbox="../media/content-safety/content-filter/create-content-filter-basic.png":::
84-
85-
1. Select **Create content filter**.
86-
1. On the **Input filters** page, you can set the filter for the input prompt. Set the action and severity level threshold for each filter type. You configure both the default filters and other filters (like Prompt Shields for jailbreak attacks) on this page. Then select **Next**.
87-
88-
:::image type="content" source="../media/content-safety/content-filter/configure-threshold.png" alt-text="Screenshot of the option to select input filters when creating a content filter." lightbox="../media/content-safety/content-filter/configure-threshold.png":::
89-
90-
Content will be annotated by category and blocked according to the threshold you set. For the violence, hate, sexual, and self-harm categories, adjust the slider to block content of high, medium, or low severity.
91-
92-
1. On the **Output filters** page, you can configure the output filter, which will be applied to all output content generated by your model. Configure the individual filters as before. This page also provides the Streaming mode option, which lets you filter content in near-real-time as it's generated by the model, reducing latency. When you're finished select **Next**.
93-
94-
Content will be annotated by each category and blocked according to the threshold. For violent content, hate content, sexual content, and self-harm content category, adjust the threshold to block harmful content with equal or higher severity levels.
95-
96-
1. Optionally, on the **Deployment** page, you can associate the content filter with a deployment. If a selected deployment already has a filter attached, you must confirm that you want to replace it. You can also associate the content filter with a deployment later. Select **Create**.
97-
98-
:::image type="content" source="../media/content-safety/content-filter/create-content-filter-deployment.png" alt-text="Screenshot of the option to select a deployment when creating a content filter." lightbox="../media/content-safety/content-filter/create-content-filter-deployment.png":::
99-
100-
Content filtering configurations are created at the hub level in AI Foundry portal. Learn more about configurability in the [Azure OpenAI docs](/azure/ai-services/openai/how-to/content-filters).
101-
102-
1. On the **Review** page, review the settings and then select **Create filter**.
103-
104-
### Use a blocklist as a filter
105-
106-
You can apply a blocklist as either an input or output filter, or both. Enable the **Blocklist** option on the **Input filter** and/or **Output filter** page. Select one or more blocklists from the dropdown, or use the built-in profanity blocklist. You can combine multiple blocklists into the same filter.
107-
108-
## Apply a content filter
109-
110-
The filter creation process gives you the option to apply the filter to the deployments you want. You can also change or remove content filters from your deployments at any time.
111-
112-
Follow these steps to apply a content filter to a deployment:
113-
114-
1. Go to [Azure AI Foundry](https://ai.azure.com) and select a hub and project.
115-
1. Select **Models + endpoints** on the left pane and choose one of your deployments, then select **Edit**.
116-
117-
:::image type="content" source="../media/content-safety/content-filter/deployment-edit.png" alt-text="Screenshot of the button to edit a deployment." lightbox="../media/content-safety/content-filter/deployment-edit.png":::
118-
119-
1. In the **Update deployment** window, select the content filter you want to apply to the deployment.
120-
121-
:::image type="content" source="../media/content-safety/content-filter/apply-content-filter.png" alt-text="Screenshot of apply content filter." lightbox="../media/content-safety/content-filter/apply-content-filter.png":::
122-
123-
Now, you can go to the playground to test whether the content filter works as expected.
124-
72+
[!INCLUDE [create-content-filter](../includes/create-content-filter.md)]
12573

12674
### Configurability (preview)
12775

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: include file
3+
description: include file
4+
author: PatrickFarley
5+
ms.reviewer: pafarley
6+
ms.author: pafarley
7+
ms.service: azure-ai-studio
8+
ms.topic: include
9+
ms.date: 11/25/2024
10+
ms.custom: include
11+
---
12+
13+
14+
## Create a content filter in Azure AI Foundry
15+
16+
For any model deployment in [Azure AI Foundry](https://ai.azure.com), you can directly use the default content filter, but you might want to have more control. For example, you could make a filter stricter or more lenient, or enable more advanced capabilities like prompt shields and protected material detection.
17+
18+
> [!TIP]
19+
> For guidance with content filters in your Azure AI Foundry project, you can read more at [Azure AI Foundry content filtering](/azure/ai-studio/concepts/content-filtering).
20+
21+
Follow these steps to create a content filter:
22+
23+
1. Go to [Azure AI Foundry](https://ai.azure.com) and navigate to your project. Then select the **Safety + security** page from the left menu and select the **Content filters** tab.
24+
25+
:::image type="content" source="../media/content-safety/content-filter/create-content-filter.png" alt-text="Screenshot of the button to create a new content filter." lightbox="../media/content-safety/content-filter/create-content-filter.png":::
26+
1. Select **+ Create content filter**.
27+
1. On the **Basic information** page, enter a name for your content filtering configuration. Select a connection to associate with the content filter. Then select **Next**.
28+
29+
:::image type="content" source="../media/content-safety/content-filter/create-content-filter-basic.png" alt-text="Screenshot of the option to select or enter basic information such as the filter name when creating a content filter." lightbox="../media/content-safety/content-filter/create-content-filter-basic.png":::
30+
31+
Now you can configure the input filters (for user prompts) and output filters (for model completion).
32+
1. On the **Input filters** page, you can set the filter for the input prompt. For the first four content categories there are three severity levels that are configurable: Low, medium, and high. You can use the sliders to set the severity threshold if you determine that your application or usage scenario requires different filtering than the default values.
33+
Some filters, such as Prompt Shields and Protected material detection, enable you to determine if the model should annotate and/or block content. Selecting **Annotate only** runs the respective model and return annotations via API response, but it will not filter content. In addition to annotate, you can also choose to block content.
34+
35+
If your use case was approved for modified content filters, you receive full control over content filtering configurations and can choose to turn filtering partially or fully off, or enable annotate only for the content harms categories (violence, hate, sexual and self-harm).
36+
37+
Content will be annotated by category and blocked according to the threshold you set. For the violence, hate, sexual, and self-harm categories, adjust the slider to block content of high, medium, or low severity.
38+
39+
:::image type="content" source="../media/content-safety/content-filter/input-filter.png" alt-text="Screenshot of input filter screen.":::
40+
1. On the **Output filters** page, you can configure the output filter, which will be applied to all output content generated by your model. Configure the individual filters as before. This page also provides the Streaming mode option, which lets you filter content in near-real-time as it's generated by the model, reducing latency. When you're finished select **Next**.
41+
42+
Content will be annotated by each category and blocked according to the threshold. For violent content, hate content, sexual content, and self-harm content category, adjust the threshold to block harmful content with equal or higher severity levels.
43+
44+
:::image type="content" source="../media/content-safety/content-filter/output-filter.png" alt-text="Screenshot of output filter screen.":::
45+
1. Optionally, on the **Deployment** page, you can associate the content filter with a deployment. If a selected deployment already has a filter attached, you must confirm that you want to replace it. You can also associate the content filter with a deployment later. Select **Create**.
46+
47+
:::image type="content" source="../media/content-safety/content-filter/create-content-filter-deployment.png" alt-text="Screenshot of the option to select a deployment when creating a content filter." lightbox="../media/content-safety/content-filter/create-content-filter-deployment.png":::
48+
49+
Content filtering configurations are created at the hub level in the Azure AI Foundry portal. Learn more about configurability in the [Azure OpenAI Service documentation](/azure/ai-services/openai/how-to/content-filters).
50+
51+
52+
1. On the **Review** page, review the settings and then select **Create filter**.
53+
54+
### Use a blocklist as a filter
55+
56+
You can apply a blocklist as either an input or output filter, or both. Enable the **Blocklist** option on the **Input filter** and/or **Output filter** page. Select one or more blocklists from the dropdown, or use the built-in profanity blocklist. You can combine multiple blocklists into the same filter.
57+
58+
## Apply a content filter
59+
60+
The filter creation process gives you the option to apply the filter to the deployments you want. You can also change or remove content filters from your deployments at any time.
61+
62+
Follow these steps to apply a content filter to a deployment:
63+
64+
1. Go to [Azure AI Foundry](https://ai.azure.com) and select a project.
65+
1. Select **Models + endpoints** on the left pane and choose one of your deployments, then select **Edit**.
66+
67+
:::image type="content" source="../media/content-safety/content-filter/deployment-edit.png" alt-text="Screenshot of the button to edit a deployment." lightbox="../media/content-safety/content-filter/deployment-edit.png":::
68+
69+
1. In the **Update deployment** window, select the content filter you want to apply to the deployment. Then select **Save and close**.
70+
71+
:::image type="content" source="../media/content-safety/content-filter/apply-content-filter.png" alt-text="Screenshot of apply content filter." lightbox="../media/content-safety/content-filter/apply-content-filter.png":::
72+
73+
You can also edit and delete a content filter configuration if required. Before you delete a content filtering configuration, you will need to unassign and replace it from any deployment in the **Deployments** tab.
74+
75+
Now, you can go to the playground to test whether the content filter works as expected.
76+
129 KB
Loading
83.2 KB
Loading
177 KB
Loading

0 commit comments

Comments
 (0)