Skip to content

Commit 9a6d7af

Browse files
committed
move foundry blocklist content to include
1 parent dcc5ee7 commit 9a6d7af

File tree

3 files changed

+43
-42
lines changed

3 files changed

+43
-42
lines changed

articles/ai-services/openai/how-to/use-blocklists.md

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ description: Learn how to use blocklists with Azure OpenAI Service
66
manager: nitinme
77
ms.service: azure-ai-openai
88
ms.topic: how-to
9-
ms.date: 10/03/2024
9+
ms.date: 12/05/2024
1010
author: PatrickFarley
1111
ms.author: pafarley
1212
---
1313

14-
# Use a blocklist in Azure OpenAI
14+
# Use a blocklist with Azure OpenAI
1515

1616
The configurable content filters are sufficient for most content moderation needs. However, you may need to filter terms specific to your use case.
1717

@@ -25,6 +25,8 @@ The configurable content filters are sufficient for most content moderation need
2525

2626
## Use blocklists
2727

28+
#### [Azure OpenAI API](#tab/api)
29+
2830
You can create blocklists with the Azure OpenAI API. The following steps help you get started.
2931

3032
### Get your token
@@ -61,7 +63,7 @@ The response code should be `201` (created a new list) or `200` (updated an exis
6163

6264
### Apply a blocklist to a content filter
6365

64-
If you haven't yet created a content filter, you can do so in the Studio in the Content Filters tab on the left hand side. In order to use the blocklist, make sure this Content Filter is applied to an Azure OpenAI deployment. You can do this in the Deployments tab on the left hand side.
66+
If you haven't yet created a content filter, you can do so in Azure AI Foundry. See [Content filtering](/azure/ai-services/openai/how-to/content-filters#create-a-content-filter-in-azure-ai-foundry).
6567

6668
To apply a **completion** blocklist to a content filter, use the following cURL command:
6769

@@ -132,9 +134,7 @@ The response code should be `200`.
132134

133135
### Analyze text with a blocklist
134136

135-
Now you can test out your deployment that has the blocklist. The easiest way to do this is in the [Azure OpenAI Studio](https://oai.azure.com/portal/). If the content was blocked either in prompt or completion, you should see an error message saying the content filtering system was triggered.
136-
137-
For instruction on calling the Azure OpenAI endpoints, visit the [Quickstart](/azure/ai-services/openai/quickstart).
137+
Now you can test out your deployment that has the blocklist. For instructions on calling the Azure OpenAI endpoints, visit the [Quickstart](/azure/ai-services/openai/quickstart).
138138

139139
In the below example, a GPT-35-Turbo deployment with a blocklist is blocking the prompt. The response returns a `400` error.
140140

@@ -249,26 +249,13 @@ If the completion itself is blocked, the response returns `200`, as the completi
249249
}
250250
```
251251

252-
## Use blocklists in Azure OpenAI Studio
253-
254-
You can also create custom blocklists in the Azure OpenAI Studio as part of your content filtering configurations (public preview). Instructions on how to create custom content filters can be found [here](/azure/ai-services/openai/how-to/content-filters). The following steps show how to create custom blocklists as part of your content filters via Azure OpenAI Studio.
255-
256-
1. Select Content Filters from the left menu. Select the Blocklists tab next to Content filters tab. Then select Create Blocklist.
257-
:::image type="content" source="../media/content-filters/blocklist-select-create.png" alt-text="Screenshot of blocklist create selection." lightbox="../media/content-filters/blocklist-select-create.png":::
258-
1. Create a name for your blocklist, add a description and select on Create Blocklist.
259-
:::image type="content" source="../media/content-filters/create-blocklist.png" alt-text="Screenshot of blocklist name and description." lightbox="../media/content-filters/create-blocklist.png":::
260-
1. Select your custom blocklist once it's created, and select Add new term.
261-
:::image type="content" source="../media/content-filters/custom-blocklist-add.png" alt-text="Screenshot of custom blocklist add term." lightbox="../media/content-filters/custom-blocklist-add.png":::
262-
1. Add a term that should be filtered, and select Add term. You can also create a regex.
263-
:::image type="content" source="../media/content-filters/custom-blocklist-add-item.png" alt-text="Screenshot of custom blocklist add item." lightbox="../media/content-filters/custom-blocklist-add-item.png":::
264-
1. You can delete each term in your blocklist.
265-
:::image type="content" source="../media/content-filters/custom-blocklist-edit.png" alt-text="Screenshot of custom blocklist edit screen." lightbox="../media/content-filters/custom-blocklist-edit.png":::
266-
1. Once the blocklist is ready, navigate to the Content filters (Preview) section and create a new customized content filter configuration. This opens a wizard with several AI content safety components. You can find more information on how to configure the main filters and optional models [here](/azure/ai-services/openai/how-to/content-filters). Go to Add blocklist (Optional).
267-
1. You'll now see all available blocklists. There are two types of blocklists – the blocklists you created, and prebuilt blocklists that Microsoft provides, in this case a Profanity blocklist (English)
268-
1. You can now decide which of the available blocklists you would like to include in your content filtering configuration. In the below example, we apply CustomBlocklist1 that we just created. The last step is to review and finish the content filtering configuration by clicking on Next.
269-
:::image type="content" source="../media/content-filters/filtering-configuration-manage.png" alt-text="Screenshot of filtering configuration management." lightbox="../media/content-filters/filtering-configuration-manage.png":::
270-
1. You can always go back and edit your configuration. Once it’s ready, select on Create content filter. The new configuration that includes your blocklists can now be applied to a deployment. Detailed instructions can be found [here](/azure/ai-services/openai/how-to/content-filters).
252+
---
253+
254+
#### [Azure AI Foundry](#tab/foundry)
255+
256+
[!INCLUDE [use-blocklists](../../../ai-studio/includes/use-blocklists.md)]
271257

258+
---
272259

273260
## Next steps
274261

articles/ai-studio/how-to/use-blocklists.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,4 @@ author: PatrickFarley
1717

1818
You can create custom blocklists in the Azure AI Foundry portal as part of your content filtering configurations. The following steps show how to create custom blocklists as part of your content filters in Azure AI Foundry portal.
1919

20-
## Create a blocklist
21-
22-
1. Go to [Azure AI Foundry](https://ai.azure.com/) and navigate to your project/hub. Then select the **Safety+ Security** page on the left nav and select the **Blocklists** tab.
23-
:::image type="content" source="../media/content-safety/content-filter/select-blocklists.png" lightbox="../media/content-safety/content-filter/select-blocklists.png" alt-text="Screenshot of the Blocklists page tab.":::
24-
1. Select **Create a blocklist**. Enter a name for your blocklist, add a description, and select an Azure OpenAI resource to connect it to. Then select **Create Blocklist**.
25-
1. Select your new blocklist once it's created. On the blocklist's page, select **Add new term**.
26-
1. Enter the term that should be filtered and select **Add term**. You can also use a regex.
27-
You can delete each term in your blocklist.
28-
29-
## Attach a blocklist to a content filter configuration
30-
31-
1. Once the blocklist is ready, go back to the **Safety+ Security** page and select the **Content filters** tab. Create a new content filter configuration. This opens a wizard with several AI content safety components.
32-
:::image type="content" source="../media/content-safety/content-filter/create-content-filter.png" lightbox="../media/content-safety/content-filter/create-content-filter.png" alt-text="Screenshot of the Create content filter button.":::
33-
1. On the **Input filter** and **Output filter** screens, toggle the **Blocklist** button on. You can then select a blocklist from the list.
34-
There are two types of blocklists: the custom blocklists you created, and prebuilt blocklists that Microsoft provides—in this case a Profanity blocklist (English).
35-
1. You can now decide which of the available blocklists you want to include in your content filtering configuration. The last step is to review and finish the content filtering configuration by selecting **Next**.
36-
You can always go back and edit your configuration. Once it’s ready, select a **Create content filter**. The new configuration that includes your blocklists can now be applied to a deployment.
20+
[!INCLUDE [use-blocklists](../includes/use-blocklists.md)]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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: 12/05/2024
10+
ms.custom: include
11+
---
12+
13+
14+
## Create a blocklist
15+
16+
1. Go to [Azure AI Foundry](https://ai.azure.com/) and navigate to your project/hub. Then select the **Safety+ Security** page on the left nav and select the **Blocklists** tab.
17+
:::image type="content" source="../media/content-safety/content-filter/select-blocklists.png" lightbox="../media/content-safety/content-filter/select-blocklists.png" alt-text="Screenshot of the Blocklists page tab.":::
18+
1. Select **Create a blocklist**. Enter a name for your blocklist, add a description, and select an Azure OpenAI resource to connect it to. Then select **Create Blocklist**.
19+
1. Select your new blocklist once it's created. On the blocklist's page, select **Add new term**.
20+
1. Enter the term that should be filtered and select **Add term**. You can also use a regex.
21+
You can delete each term in your blocklist.
22+
23+
## Attach a blocklist to a content filter configuration
24+
25+
1. Once the blocklist is ready, go back to the **Safety+ Security** page and select the **Content filters** tab. Create a new content filter configuration. This opens a wizard with several AI content safety components.
26+
:::image type="content" source="../media/content-safety/content-filter/create-content-filter.png" lightbox="../media/content-safety/content-filter/create-content-filter.png" alt-text="Screenshot of the Create content filter button.":::
27+
1. On the **Input filter** and **Output filter** screens, toggle the **Blocklist** button on. You can then select a blocklist from the list.
28+
There are two types of blocklists: the custom blocklists you created, and prebuilt blocklists that Microsoft provides—in this case a Profanity blocklist (English).
29+
1. You can now decide which of the available blocklists you want to include in your content filtering configuration. The last step is to review and finish the content filtering configuration by selecting **Next**.
30+
You can always go back and edit your configuration. Once it’s ready, select a **Create content filter**. The new configuration that includes your blocklists can now be applied to a deployment.

0 commit comments

Comments
 (0)