Skip to content

Commit e7d1377

Browse files
authored
Merge pull request #269593 from MicrosoftDocs/main
3/20 11:00 AM IST Publish
2 parents 20ae03d + a67f392 commit e7d1377

File tree

100 files changed

+1057
-382
lines changed

Some content is hidden

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

100 files changed

+1057
-382
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/openai/concepts/content-filter.md

Lines changed: 99 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,6 +339,93 @@ 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

344431
```python
@@ -348,11 +435,11 @@ import os
348435
import openai
349436
openai.api_type = "azure"
350437
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
351-
openai.api_version = "2023-06-01-preview" # API version required to use Annotations
438+
openai.api_version = "2024-03-01-preview" # API version required to use Annotations
352439
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
353440

354441
response = openai.Completion.create(
355-
engine="gpt-35-turbo", # engine = "deployment_name".
442+
engine="gpt-35-turbo-instruct", # engine = "deployment_name".
356443
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,
357444
# while content detected at severity level low isn't filtered by the content filters.
358445
)
@@ -407,8 +494,13 @@ print(response)
407494
],
408495
"created": 1699386280,
409496
"id": "chatcmpl-8IMI4HzcmcK6I77vpOJCPt0Vcf8zJ",
410-
"model": "gpt-35-turbo",
411-
"object": "chat.completion",
497+
"model": "gpt-35-turbo-instruct",
498+
"object": "text.completion",
499+
"usage": {
500+
"completion_tokens": 40,
501+
"prompt_tokens": 11,
502+
"total_tokens": 417
503+
},
412504
"prompt_filter_results": [
413505
{
414506
"content_filter_results": {
@@ -439,12 +531,7 @@ print(response)
439531
},
440532
"prompt_index": 0
441533
}
442-
],
443-
"usage": {
444-
"completion_tokens": 40,
445-
"prompt_tokens": 11,
446-
"total_tokens": 417
447-
}
534+
]
448535
}
449536
```
450537

@@ -457,7 +544,7 @@ import os
457544
import openai
458545
openai.api_type = "azure"
459546
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
460-
openai.api_version = "2023-06-01-preview" # API version required to use Annotations
547+
openai.api_version = "2024-03-01-preview" # API version required to use Annotations
461548
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
462549

463550
try:

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

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,34 @@ pip install openai==0.28.1
3636

3737
1. Replace the contents of quickstart.py with the following code. Modify the code to add your deployment name:
3838

39-
```python
39+
# [OpenAI Python 1.x](#tab/python-new)
40+
41+
```python
42+
import os
43+
from openai import AzureOpenAI
44+
45+
client = AzureOpenAI(
46+
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
47+
api_version="2024-02-01",
48+
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
49+
)
50+
51+
deployment_id = "YOUR-DEPLOYMENT-NAME-HERE" #This will correspond to the custom name you chose for your deployment when you deployed a model."
52+
audio_test_file = "./wikipediaOcelot.wav"
53+
54+
result = client.audio.transcriptions.create(
55+
file=open(audio_test_file, "rb"),
56+
model=deployment_id
57+
)
58+
59+
print(result)
60+
```
61+
62+
# [OpenAI Python 0.28.1](#tab/python)
63+
64+
65+
66+
```python
4067
import openai
4168
import time
4269
import os
@@ -59,7 +86,9 @@ pip install openai==0.28.1
5986
)
6087

6188
print(result)
62-
```
89+
```
90+
91+
---
6392

6493
Run the application with the python command on your quickstart file:
6594

articles/ai-services/translator/document-translation/reference/synchronous-rest-api-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Synchronously translate a single document.
3030
`POST`:
3131

3232
```bash
33-
{your-document-translation-endpoint}/translator/document:translate?sourceLanguage=en&targetLanguage=hi&api-version=2023-11-01-preview
33+
curl -i -X POST "{your-document-translation-endpoint}/translator/document:translate?sourceLanguage=en&targetLanguage=hi&api-version=2023-11-01-preview" -H "Ocp-Apim-Subscription-Key:{your-key}" -F "document={path-to-your-document-with-file-extension};type={ContentType}/{file-extension}" -F "glossary={path-to-your-glossary-with-file-extension};type={ContentType}/{file-extension}" -o "{path-to-output-file}"
3434

3535
```
3636

articles/aks/TOC.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,6 @@
703703
items:
704704
- name: Upgrade options
705705
href: upgrade-cluster.md
706-
- name: Stop cluster upgrades automatically on API breaking changes
707-
href: stop-cluster-upgrade-api-breaking-changes.md
708706
- name: Perform manual upgrades
709707
items:
710708
- name: Upgrade an AKS cluster
@@ -727,7 +725,8 @@
727725
href: auto-upgrade-node-os-image.md
728726
- name: Upgrade node OS images automatically with GitHub Actions
729727
href: node-upgrade-github-actions.md
730-
728+
- name: Stop cluster upgrades automatically on API breaking changes
729+
href: stop-cluster-upgrade-api-breaking-changes.md
731730
- name: Azure Linux container host for AKS
732731
items:
733732
- name: Use Azure Linux for AKS

0 commit comments

Comments
 (0)