Skip to content

Commit 089d9a2

Browse files
committed
attempt include
1 parent 1db3cb3 commit 089d9a2

File tree

2 files changed

+65
-53
lines changed

2 files changed

+65
-53
lines changed

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 [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: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
3+
4+
## Create a content filter
5+
6+
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.
7+
8+
For guidance with content filters in your Azure AI Studio project, you can read more at [Azure AI Studio content filtering](/azure/ai-studio/concepts/content-filtering).
9+
10+
Follow these steps to create a content filter:
11+
12+
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** tab.
13+
:::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":::
14+
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**.
15+
:::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":::
16+
1. Select **Create content filter**. Now you can configure the **input filters** (for user prompts) and **output filters** (for model completion).
17+
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.
18+
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.
19+
20+
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).
21+
22+
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.
23+
24+
:::image type="content" source="../media/content-filters/input-filter.png" alt-text="Screenshot of input filter screen.":::
25+
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**.
26+
27+
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.
28+
29+
:::image type="content" source="../media/content-filters/output-filter.png" alt-text="Screenshot of output filter screen.":::
30+
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**.
31+
32+
:::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":::
33+
34+
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).
35+
36+
You can create multiple content filtering configurations as per your requirements.
37+
38+
:::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":::
39+
1. On the **Review** page, review the settings and then select **Create filter**.
40+
41+
### Use a blocklist as a filter
42+
43+
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.
44+
45+
## Apply a content filter
46+
47+
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.
48+
49+
Follow these steps to apply a content filter to a deployment:
50+
51+
1. Go to [AI Foundry](https://ai.azure.com) and select a hub and project.
52+
1. Select **Models + endpoints** on the left pane and choose one of your deployments, then select **Edit**.
53+
54+
:::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":::
55+
56+
1. In the **Update deployment** window, select the content filter you want to apply to the deployment. Then select **Save and close**.
57+
58+
:::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":::
59+
60+
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.
61+
62+
63+
Now, you can go to the playground to test whether the content filter works as expected.
64+

0 commit comments

Comments
 (0)