Skip to content

Commit bf91b6b

Browse files
authored
Merge pull request #268921 from MicrosoftDocs/main
3/13 OOB Publish at 8:30am
2 parents c71f087 + edd9f27 commit bf91b6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+229
-153
lines changed

articles/ai-services/openai/api-version-deprecation.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: cognitive-services
55
manager: nitinme
66
ms.service: azure-ai-openai
77
ms.topic: conceptual
8-
ms.date: 03/07/2024
8+
ms.date: 03/12/2024
99
author: mrbullwinkle
1010
ms.author: mbullwin
1111
recommendations: false
@@ -17,7 +17,7 @@ ms.custom:
1717
This article is to help you understand the support lifecycle for the Azure OpenAI API previews. New preview APIs target a monthly release cadence. Post April 2, 2024, the latest three preview APIs will remain supported while older APIs will no longer be supported.
1818

1919
> [!NOTE]
20-
> The `2023-06-01-preview` API will remain supported at this time, as `DALL-E 2` is only available in this API version. `DALL-E 3` is supported in the latest API releases.
20+
> The `2023-06-01-preview` API will remain supported at this time, as `DALL-E 2` is only available in this API version. `DALL-E 3` is supported in the latest API releases. The `2023-10-01-preview` API will also remain supported at this time.
2121
2222
## Latest preview API release
2323

@@ -28,13 +28,20 @@ This version contains support for all the latest Azure OpenAI features including
2828

2929
- [Embeddings `encoding_format` and `dimensions` parameters] [**Added in 2024-03-01-preview**]
3030
- [Assistants API](./assistants-reference.md). [**Added in 2024-02-15-preview**]
31-
- [DALL-E 3](./dall-e-quickstart.md). [**Added in 2023-12-01-preview**]
3231
- [Text to speech](./text-to-speech-quickstart.md). [**Added in 2024-02-15-preview**]
32+
- [DALL-E 3](./dall-e-quickstart.md). [**Added in 2023-12-01-preview**]
3333
- [Fine-tuning](./how-to/fine-tuning.md) `gpt-35-turbo`, `babbage-002`, and `davinci-002` models.[**Added in 2023-10-01-preview**]
3434
- [Whisper](./whisper-quickstart.md). [**Added in 2023-09-01-preview**]
3535
- [Function calling](./how-to/function-calling.md) [**Added in 2023-07-01-preview**]
3636
- [Retrieval augmented generation with the on your data feature](./use-your-data-quickstart.md). [**Added in 2023-06-01-preview**]
3737

38+
## Latest GA API release
39+
40+
Azure OpenAI API version [2024-02-01](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01/inference.json)
41+
is currently the latest GA API release. This API version is the replacement for the previous`2023-05-15` GA API release.
42+
43+
This version contains support for the latest GA features like Whisper, DALL-E 3, fine-tuning, on your data, etc. Any preview features that were released after the `2023-12-01-preview` release like Assistants, TTS, certain on your data datasources, are only supported in the latest preview API releases.
44+
3845
## Retiring soon
3946

4047
On April 2, 2024 the following API preview releases will be retired and will stop accepting API requests:
@@ -43,7 +50,6 @@ On April 2, 2024 the following API preview releases will be retired and will sto
4350
- 2023-07-01-preview
4451
- 2023-08-01-preview
4552
- 2023-09-01-preview
46-
- 2023-10-01-preview
4753
- 2023-12-01-preview
4854

4955
To avoid service disruptions, you must update to use the latest preview version before the retirement date.

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Azure OpenAI Service content filtering
33
titleSuffix: Azure OpenAI
4-
description: Learn about the content filtering capabilities of Azure OpenAI in Azure AI services
4+
description: Learn about the content filtering capabilities of Azure OpenAI in Azure AI services.
55
author: mrbullwinkle
66
ms.author: mbullwin
77
ms.service: azure-ai-openai
@@ -14,28 +14,28 @@ manager: nitinme
1414
# Content filtering
1515

1616
> [!IMPORTANT]
17-
> The content filtering system isn't applied to prompts and completions processed by the Whisper model in Azure OpenAI Service. Learn more about the [Whisper model in Azure OpenAI](models.md#whisper-preview).
17+
> The content filtering system isn't applied to prompts and completions processed by the Whisper model in Azure OpenAI Service. Learn more about the [Whisper model in Azure OpenAI](models.md#whisper).
1818
1919
Azure OpenAI Service includes a content filtering system that works alongside core models. This system works by running both the prompt and completion through an ensemble of classification models aimed at detecting and preventing the output of harmful content. The content filtering system detects and takes action on specific categories of potentially harmful content in both input prompts and output completions. Variations in API configurations and application design might affect completions and thus filtering behavior.
2020

2121
The content filtering models for the hate, sexual, violence, and self-harm categories have been specifically trained and tested on the following languages: English, German, Japanese, Spanish, French, Italian, Portuguese, and Chinese. However, the service can work in many other languages, but the quality might vary. In all cases, you should do your own testing to ensure that it works for your application.
2222

23-
In addition to the content filtering system, the Azure OpenAI Service performs monitoring to detect content and/or behaviors that suggest use of the service in a manner that might violate applicable product terms. For more information about understanding and mitigating risks associated with your application, see the [Transparency Note for Azure OpenAI](/legal/cognitive-services/openai/transparency-note?tabs=text). For more information about how data is processed in connection with content filtering and abuse monitoring, see [Data, privacy, and security for Azure OpenAI Service](/legal/cognitive-services/openai/data-privacy?context=/azure/ai-services/openai/context/context#preventing-abuse-and-harmful-content-generation).
23+
In addition to the content filtering system, the Azure OpenAI Service performs monitoring to detect content and/or behaviors that suggest use of the service in a manner that might violate applicable product terms. For more information about understanding and mitigating risks associated with your application, see the [Transparency Note for Azure OpenAI](/legal/cognitive-services/openai/transparency-note?tabs=text). For more information about how data is processed for content filtering and abuse monitoring, see [Data, privacy, and security for Azure OpenAI Service](/legal/cognitive-services/openai/data-privacy?context=/azure/ai-services/openai/context/context#preventing-abuse-and-harmful-content-generation).
2424

2525
The following sections provide information about the content filtering categories, the filtering severity levels and their configurability, and API scenarios to be considered in application design and implementation.
2626

2727
## Content filtering categories
2828

2929
The content filtering system integrated in the Azure OpenAI Service contains:
3030
* Neural multi-class classification models aimed at detecting and filtering harmful content; the models cover four categories (hate, sexual, violence, and self-harm) across four severity levels (safe, low, medium, and high). Content detected at the 'safe' severity level is labeled in annotations but isn't subject to filtering and isn't configurable.
31-
* Additional optional classification models aimed at detecting jailbreak risk and known content for text and code; these models are binary classifiers that flag whether user or model behavior qualifies as a jailbreak attack or match to known text or source code. The use of these models is optional, but use of protected material code model may be required for Customer Copyright Commitment coverage.
31+
* Other optional classification models aimed at detecting jailbreak risk and known content for text and code; these models are binary classifiers that flag whether user or model behavior qualifies as a jailbreak attack or match to known text or source code. The use of these models is optional, but use of protected material code model may be required for Customer Copyright Commitment coverage.
3232

3333
## Harm categories
3434

3535
|Category|Description|
3636
|--------|-----------|
37-
| Hate and fairness |Hate and fairness-related harms refer to any content that attacks or uses pejorative or discriminatory language with reference to a person or Identity groups on the basis of certain differentiating attributes of these groups including but not limited to race, ethnicity, nationality, gender identity groups and expression, sexual orientation, religion, immigration status, ability status, personal appearance and body size. </br></br> Fairness is concerned with ensuring that AI systems treat all groups of people equitably without contributing to existing societal inequities. Similar to hate speech, fairness-related harms hinge upon disparate treatment of Identity groups.   |
38-
| Sexual | Sexual describes language related to anatomical organs and genitals, romantic relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an assault or a forced sexual violent act against one’s will, prostitution, pornography and abuse.   |
37+
| Hate and fairness |Hate and fairness-related harms refer to any content that attacks or uses pejorative or discriminatory language with reference to a person or Identity groups on the basis of certain differentiating attributes of these groups including but not limited to race, ethnicity, nationality, gender identity groups and expression, sexual orientation, religion, immigration status, ability status, personal appearance, and body size. </br></br> Fairness is concerned with ensuring that AI systems treat all groups of people equitably without contributing to existing societal inequities. Similar to hate speech, fairness-related harms hinge upon disparate treatment of Identity groups.   |
38+
| Sexual | Sexual describes language related to anatomical organs and genitals, romantic relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an assault or a forced sexual violent act against one’s will, prostitution, pornography, and abuse.   |
3939
| Violence | Violence describes language related to physical actions intended to hurt, injure, damage, or kill someone or something; describes weapons, guns and related entities, such as manufactures, associations, legislation, etc.   |
4040
| Self-Harm | Self-harm describes language related to physical actions intended to purposely hurt, injure, damage one’s body or kill oneself.|
4141
| Jailbreak risk | Jailbreak 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 role play to subtle subversion of the safety objective. |
@@ -55,7 +55,7 @@ The default content filtering configuration is set to filter at the medium sever
5555

5656
| Severity filtered | Configurable for prompts | Configurable for completions | Descriptions |
5757
|-------------------|--------------------------|------------------------------|--------------|
58-
| Low, medium, high | Yes | Yes | Strictest filtering configuration. Content detected at severity levels low, medium and high is filtered.|
58+
| Low, medium, high | Yes | Yes | Strictest filtering configuration. Content detected at severity levels low, medium, and high is filtered.|
5959
| Medium, high | Yes | Yes | Default setting. Content detected at severity level low isn't filtered, content at medium and high is filtered.|
6060
| High | Yes| Yes | Content detected at severity levels low and medium isn't filtered. Only content at severity level high is filtered.|
6161
| No filters | If approved<sup>\*</sup>| If approved<sup>\*</sup>| No content is filtered regardless of severity level detected. Requires approval<sup>\*</sup>.|
@@ -68,7 +68,7 @@ Content filtering configurations are created within a Resource in Azure AI Studi
6868

6969
## Scenario details
7070

71-
When the content filtering system detects harmful content, you'll receive either an error on the API call if the prompt was deemed inappropriate or the `finish_reason` on the response will be `content_filter` to signify that some of the completion was filtered. When building your application or system, you'll want to account for these scenarios where the content returned by the Completions API is filtered, which might result in content that is incomplete. How you act on this information will be application specific. The behavior can be summarized in the following points:
71+
When the content filtering system detects harmful content, you receive either an error on the API call if the prompt was deemed inappropriate, or the `finish_reason` on the response will be `content_filter` to signify that some of the completion was filtered. When building your application or system, you'll want to account for these scenarios where the content returned by the Completions API is filtered, which might result in content that is incomplete. How you act on this information will be application specific. The behavior can be summarized in the following points:
7272

7373
- Prompts that are classified at a filtered category and severity level will return an HTTP 400 error.
7474
- Non-streaming completions calls won't return any content when the content is filtered. The `finish_reason` value will be set to content_filter. In rare cases with longer responses, a partial result can be returned. In these cases, the `finish_reason` will be updated.
@@ -290,10 +290,11 @@ The table below outlines the various ways content filtering can appear:
290290
}
291291
```
292292

293-
## Annotations (preview)
293+
## Annotations
294294

295-
### Main content filters
296-
When annotations are enabled as shown in the code snippet below, the following information is returned via the API for the main categories (hate and fairness, sexual, violence, and self-harm):
295+
### Content filters
296+
297+
When annotations are enabled as shown in the code snippet below, the following information is returned via the API for the categories hate and fairness, sexual, violence, and self-harm:
297298
- content filtering category (hate, sexual, violence, self_harm)
298299
- the severity level (safe, low, medium or high) within each content category
299300
- filtering status (true or false).
@@ -302,7 +303,7 @@ When annotations are enabled as shown in the code snippet below, the following i
302303

303304
Optional models can be enabled in annotate (returns information when content was flagged, but not filtered) or filter mode (returns information when content was flagged and filtered).
304305

305-
When annotations are enabled as shown in the code snippet below, the following information is returned by the API for optional models jailbreak risk, protected material text and protected material code:
306+
When annotations are enabled as shown in the code snippet below, the following information is returned by the API for optional models: jailbreak risk, protected material text and protected material code:
306307
- category (jailbreak, protected_material_text, protected_material_code),
307308
- detected (true or false),
308309
- filtered (true or false).
@@ -313,7 +314,7 @@ For the protected material code model, the following additional information is r
313314

314315
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.
315316

316-
Annotations are currently in preview for Completions and Chat Completions (GPT models); the following code snippet shows how to use annotations in preview:
317+
Annotations are currently available in the GA API version `2024-02-01` and in all preview versions starting from `2023-06-01-preview` for Completions and Chat Completions (GPT models). The following code snippet shows how to use annotations:
317318

318319
# [OpenAI Python 0.28.1](#tab/python)
319320

@@ -324,7 +325,7 @@ import os
324325
import openai
325326
openai.api_type = "azure"
326327
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
327-
openai.api_version = "2023-06-01-preview" # API version required to test out Annotations preview
328+
openai.api_version = "2023-06-01-preview" # API version required to use Annotations
328329
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
329330

330331
response = openai.Completion.create(
@@ -344,7 +345,6 @@ print(response)
344345
"choices": [
345346
{
346347
"content_filter_results": {
347-
"custom_blocklists": [],
348348
"hate": {
349349
"filtered": false,
350350
"severity": "safe"
@@ -389,7 +389,6 @@ print(response)
389389
"prompt_filter_results": [
390390
{
391391
"content_filter_results": {
392-
"custom_blocklists": [],
393392
"hate": {
394393
"filtered": false,
395394
"severity": "safe"
@@ -435,7 +434,7 @@ import os
435434
import openai
436435
openai.api_type = "azure"
437436
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
438-
openai.api_version = "2023-06-01-preview" # API version required to test out Annotations preview
437+
openai.api_version = "2023-06-01-preview" # API version required to use Annotations
439438
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
440439

441440
try:
@@ -589,7 +588,7 @@ violence : @{filtered=False; severity=safe}
589588
590589
---
591590
592-
For details on the inference REST API endpoints for Azure OpenAI and how to create Chat and Completions please follow [Azure OpenAI Service REST API reference guidance](../reference.md). Annotations are returned for all scenarios when using `2023-06-01-preview`.
591+
For details on the inference REST API endpoints for Azure OpenAI and how to create Chat and Completions please 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`.
593592
594593
### Example scenario: An input prompt containing content that is classified at a filtered category and severity level is sent to the completions API
595594

0 commit comments

Comments
 (0)