Skip to content

Commit 1341ede

Browse files
committed
Merge branch 'main' into release-fabric-mirroring-pupr
2 parents d3c448f + 6d5d1d5 commit 1341ede

File tree

151 files changed

+1728
-525
lines changed

Some content is hidden

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

151 files changed

+1728
-525
lines changed

.openpublishing.redirection.azure-kubernetes-service.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@
464464
},
465465
{
466466
"source_path_from_root": "/articles/aks/operator-best-practices-run-at-scale.md",
467-
"redirect_url": "/azure/aks/best-practices-performance-scale-large.md",
467+
"redirect_url": "/azure/aks/best-practices-performance-scale-large",
468468
"redirect_document_id": false
469469
}
470470
]

articles/ai-services/computer-vision/includes/how-to-guides/analyze-image-40-rest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ You can also do image analysis with a custom trained model. To create and train
7474

7575
To use a custom model, don't use the features query parameter. Instead, set the `model-name` parameter to the name of your model as shown here. Replace `MyCustomModelName` with your custom model name.
7676

77-
`https://<endpoint>/computervision/imageanalysis:analyze?api-version=2024-02-01&model-name=MyCustomModelName`
77+
`https://<endpoint>/computervision/imageanalysis:analyze?api-version=2023-02-01&model-name=MyCustomModelName`
7878

7979

8080
### Specify languages

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

Lines changed: 101 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ import os
325325
from openai import AzureOpenAI
326326
client = AzureOpenAI(
327327
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
328-
api_version="2023-10-01-preview",
328+
api_version="2024-03-01-preview",
329329
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
330330
)
331331

@@ -339,20 +339,109 @@ response = client.completions.create(
339339
print(response.model_dump_json(indent=2))
340340
```
341341

342+
### Output
343+
344+
```json
345+
{
346+
"choices": [
347+
{
348+
"content_filter_results": {
349+
"hate": {
350+
"filtered": false,
351+
"severity": "safe"
352+
},
353+
"protected_material_code": {
354+
"citation": {
355+
"URL": " https://github.com/username/repository-name/path/to/file-example.txt",
356+
"license": "EXAMPLE-LICENSE"
357+
},
358+
"detected": true,
359+
"filtered": false
360+
},
361+
"protected_material_text": {
362+
"detected": false,
363+
"filtered": false
364+
},
365+
"self_harm": {
366+
"filtered": false,
367+
"severity": "safe"
368+
},
369+
"sexual": {
370+
"filtered": false,
371+
"severity": "safe"
372+
},
373+
"violence": {
374+
"filtered": false,
375+
"severity": "safe"
376+
}
377+
},
378+
"finish_reason": "stop",
379+
"index": 0,
380+
"message": {
381+
"content": "Example model response will be returned ",
382+
"role": "assistant"
383+
}
384+
}
385+
],
386+
"created": 1699386280,
387+
"id": "chatcmpl-8IMI4HzcmcK6I77vpOJCPt0Vcf8zJ",
388+
"model": "gpt-35-turbo-instruct",
389+
"object": "text.completion",
390+
"usage": {
391+
"completion_tokens": 40,
392+
"prompt_tokens": 11,
393+
"total_tokens": 417
394+
},
395+
"prompt_filter_results": [
396+
{
397+
"content_filter_results": {
398+
"hate": {
399+
"filtered": false,
400+
"severity": "safe"
401+
},
402+
"jailbreak": {
403+
"detected": false,
404+
"filtered": false
405+
},
406+
"profanity": {
407+
"detected": false,
408+
"filtered": false
409+
},
410+
"self_harm": {
411+
"filtered": false,
412+
"severity": "safe"
413+
},
414+
"sexual": {
415+
"filtered": false,
416+
"severity": "safe"
417+
},
418+
"violence": {
419+
"filtered": false,
420+
"severity": "safe"
421+
}
422+
},
423+
"prompt_index": 0
424+
}
425+
]
426+
}
427+
```
428+
342429
# [OpenAI Python 0.28.1](#tab/python)
343430

431+
[!INCLUDE [Deprecation](../includes/deprecation.md)]
432+
344433
```python
345434
# os.getenv() for the endpoint and key assumes that you are using environment variables.
346435

347436
import os
348437
import openai
349438
openai.api_type = "azure"
350439
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
351-
openai.api_version = "2023-06-01-preview" # API version required to use Annotations
440+
openai.api_version = "2024-03-01-preview" # API version required to use Annotations
352441
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
353442

354443
response = openai.Completion.create(
355-
engine="gpt-35-turbo", # engine = "deployment_name".
444+
engine="gpt-35-turbo-instruct", # engine = "deployment_name".
356445
messages=[{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Example prompt that leads to a protected code completion that was detected, but not filtered"}] # Content that is detected at severity level medium or high is filtered,
357446
# while content detected at severity level low isn't filtered by the content filters.
358447
)
@@ -407,8 +496,13 @@ print(response)
407496
],
408497
"created": 1699386280,
409498
"id": "chatcmpl-8IMI4HzcmcK6I77vpOJCPt0Vcf8zJ",
410-
"model": "gpt-35-turbo",
411-
"object": "chat.completion",
499+
"model": "gpt-35-turbo-instruct",
500+
"object": "text.completion",
501+
"usage": {
502+
"completion_tokens": 40,
503+
"prompt_tokens": 11,
504+
"total_tokens": 417
505+
},
412506
"prompt_filter_results": [
413507
{
414508
"content_filter_results": {
@@ -439,12 +533,7 @@ print(response)
439533
},
440534
"prompt_index": 0
441535
}
442-
],
443-
"usage": {
444-
"completion_tokens": 40,
445-
"prompt_tokens": 11,
446-
"total_tokens": 417
447-
}
536+
]
448537
}
449538
```
450539

@@ -457,7 +546,7 @@ import os
457546
import openai
458547
openai.api_type = "azure"
459548
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
460-
openai.api_version = "2023-06-01-preview" # API version required to use Annotations
549+
openai.api_version = "2024-03-01-preview" # API version required to use Annotations
461550
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
462551

463552
try:

articles/ai-services/openai/how-to/embeddings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ print(response.model_dump_json(indent=2))
5151

5252
# [OpenAI Python 0.28.1](#tab/python)
5353

54+
[!INCLUDE [Deprecation](../includes/deprecation.md)]
55+
5456
```python
5557
import openai
5658

articles/ai-services/openai/how-to/function-calling.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ When functions are provided, by default the `function_call` is set to `"auto"` a
149149

150150
# [OpenAI Python 0.28.1](#tab/python)
151151

152+
[!INCLUDE [Deprecation](../includes/deprecation.md)]
153+
154+
152155
```python
153156

154157
import os

articles/ai-services/openai/includes/chat-completion.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ Microsoft was founded by Bill Gates and Paul Allen. They established the company
110110

111111
# [OpenAI Python 0.28.1](#tab/python)
112112

113+
[!INCLUDE [Deprecation](../includes/deprecation.md)]
114+
113115
```python
114116
import os
115117
import openai

articles/ai-services/openai/includes/chatgpt-python.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ pip install openai
3737

3838
# [OpenAI Python 0.28.1](#tab/python)
3939

40+
[!INCLUDE [Deprecation](../includes/deprecation.md)]
41+
4042
```console
4143
pip install openai==0.28.1
4244
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Python 0.28.1 deprecated
3+
titleSuffix: Azure OpenAI Service
4+
description: Python library deprecation
5+
manager: nitinme
6+
ms.service: azure-ai-openai
7+
ms.topic: include
8+
ms.date: 03/13/2024
9+
---
10+
11+
> [!NOTE]
12+
> The OpenAI Python library version `0.28.1` is deprecated. We recommend using `1.x`. Consult our [migration guide](../how-to/migration.md) for information on moving from `0.28.1` to `1.x`.

articles/ai-services/openai/includes/embeddings-python.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pip install openai num2words matplotlib plotly scipy scikit-learn pandas tiktoke
3131

3232
# [OpenAI Python 0.28.1](#tab/python)
3333

34+
[!INCLUDE [Deprecation](../includes/deprecation.md)]
35+
3436
```cmd
3537
pip install "openai==0.28.1" num2words matplotlib plotly scipy scikit-learn pandas tiktoken
3638
```

articles/ai-services/openai/includes/fine-tuning-python.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ print("Validation file ID:", validation_file_id)
181181

182182
# [OpenAI Python 0.28.1](#tab/python)
183183

184+
[!INCLUDE [Deprecation](../includes/deprecation.md)]
185+
184186
```python
185187
# Upload fine-tuning files
186188

0 commit comments

Comments
 (0)