Skip to content

Commit 7f85ac4

Browse files
Merge pull request #268881 from mrbullwinkle/mrb_03_12_2024_code
[Release Branch] [Azure OpenAI] quickstart updates
2 parents 5381344 + d7a8129 commit 7f85ac4

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.date: 11/15/2023
1818
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services?azure-portal=true)
1919
- Access granted to Azure OpenAI Service in the desired Azure subscription.
2020
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI Service by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access?azure-portal=true).
21-
- [Python 3.7.1 or later version](https://www.python.org?azure-portal=true).
21+
- [Python 3.8 or later version](https://www.python.org?azure-portal=true).
2222
- The following Python libraries: os.
2323
- An Azure OpenAI Service resource with either the `gpt-35-turbo` or the `gpt-4` models deployed. For more information about model deployment, see the [resource deployment guide](../how-to/create-resource.md).
2424

@@ -69,7 +69,7 @@ import openai
6969
openai.api_type = "azure"
7070
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
7171
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
72-
openai.api_version = "2023-05-15"
72+
openai.api_version = "2024-02-01"
7373

7474
response = openai.ChatCompletion.create(
7575
engine="gpt-35-turbo", # engine = "deployment_name".
@@ -96,7 +96,7 @@ from openai import AzureOpenAI
9696
client = AzureOpenAI(
9797
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
9898
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
99-
api_version="2023-05-15"
99+
api_version="2024-02-01"
100100
)
101101

102102
response = client.chat.completions.create(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ ms.date: 03/21/2023
3535
In a bash shell, run the following command. You will need to replace `gpt-35-turbo` with the deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 models. Entering the model name will result in an error unless you chose a deployment name that is identical to the underlying model name.
3636

3737
```bash
38-
curl $AZURE_OPENAI_ENDPOINT/openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-05-15 \
38+
curl $AZURE_OPENAI_ENDPOINT/openai/deployments/gpt-35-turbo/chat/completions?api-version=2024-02-01 \
3939
-H "Content-Type: application/json" \
4040
-H "api-key: $AZURE_OPENAI_API_KEY" \
4141
-d '{"messages":[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Does Azure OpenAI support customer managed keys?"},{"role": "assistant", "content": "Yes, customer managed keys are supported by Azure OpenAI."},{"role": "user", "content": "Do other Azure AI services support this too?"}]}'
4242

4343
```
4444

45-
The format of your first line of the command with an example endpoint would appear as follows `curl https://docs-test-001.openai.azure.com/openai/deployments/{YOUR-DEPLOYMENT_NAME_HERE}/chat/completions?api-version=2023-05-15 \` If you encounter an error double check to make sure that you don't have a doubling of the `/` at the separation between your endpoint and `/openai/deployments`.
45+
The format of your first line of the command with an example endpoint would appear as follows `curl https://docs-test-001.openai.azure.com/openai/deployments/{YOUR-DEPLOYMENT_NAME_HERE}/chat/completions?api-version=2024-02-01 \` If you encounter an error double check to make sure that you don't have a doubling of the `/` at the separation between your endpoint and `/openai/deployments`.
4646

4747
If you want to run this command in a normal Windows command prompt you would need to alter the text to remove the `\` and line breaks.
4848

articles/ai-services/openai/includes/dall-e-python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Use this guide to get started generating images with the Azure OpenAI SDK for Py
2121

2222
- An Azure subscription. <a href="https://azure.microsoft.com/free/ai-services" target="_blank">Create one for free</a>.
2323
- Access granted to DALL-E in the desired Azure subscription.
24-
- <a href="https://www.python.org/" target="_blank">Python 3.7.1 or later version</a>.
24+
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>.
2525
- An Azure OpenAI resource created in the `EastUS`, `AustraliaEast`, or `SwedenCentral` region.
2626
- Then, you need to deploy a `dalle3` model with your Azure resource. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
2727

2828
#### [DALL-E 2 (preview)](#tab/dalle2)
2929

3030
- An Azure subscription. <a href="https://azure.microsoft.com/free/ai-services" target="_blank">Create one for free</a>.
3131
- Access granted to DALL-E in the desired Azure subscription.
32-
- <a href="https://www.python.org/" target="_blank">Python 3.7.1 or later version</a>.
32+
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>.
3333
- An Azure OpenAI resource created in the `EastUS` region. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
3434

3535
---

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.date: 01/03/2024
1717
- Access granted to Azure OpenAI in the desired Azure subscription
1818

1919
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. Open an issue on this repo to contact us if you have an issue.
20-
- <a href="https://www.python.org/" target="_blank">Python 3.7.1 or later version</a>
20+
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>
2121
- The following Python libraries: os, requests, json
2222
- An Azure OpenAI Service resource with a `gpt-35-turbo-instruct` model deployed. For more information about model deployment, see the [resource deployment guide](../how-to/create-resource.md).
2323

@@ -82,7 +82,7 @@ import openai
8282
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
8383
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
8484
openai.api_type = 'azure'
85-
openai.api_version = '2023-05-15' # this might change in the future
85+
openai.api_version = '2024-02-01' # this might change in the future
8686

8787
deployment_name='REPLACE_WITH_YOUR_DEPLOYMENT_NAME' #This will correspond to the custom name you chose for your deployment when you deployed a model.
8888

@@ -102,7 +102,7 @@ from openai import AzureOpenAI
102102

103103
client = AzureOpenAI(
104104
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
105-
api_version="2023-12-01-preview",
105+
api_version="2024-02-01",
106106
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
107107
)
108108

articles/ai-services/openai/includes/rest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ Create and assign persistent environment variables for your key and endpoint.
4949
In a bash shell, run the following command. You will need to replace `gpt-35-turbo-instruct` with the deployment name you chose when you deployed the `gpt-35-turbo-instruct` model. Entering the model name will result in an error unless you chose a deployment name that is identical to the underlying model name.
5050

5151
```bash
52-
curl $AZURE_OPENAI_ENDPOINT/openai/deployments/gpt-35-turbo-instruct/completions?api-version=2023-05-15 \
52+
curl $AZURE_OPENAI_ENDPOINT/openai/deployments/gpt-35-turbo-instruct/completions?api-version=2024-02-01 \
5353
-H "Content-Type: application/json" \
5454
-H "api-key: $AZURE_OPENAI_API_KEY" \
5555
-d "{\"prompt\": \"Once upon a time\"}"
5656
```
5757

58-
The format of your first line of the command with an example endpoint would appear as follows `curl https://docs-test-001.openai.azure.com/openai/deployments/{YOUR-DEPLOYMENT_NAME_HERE}/completions?api-version=2023-05-15 \`. If you encounter an error double check to make sure that you don't have a doubling of the `/` at the separation between your endpoint and `/openai/deployments`.
58+
The format of your first line of the command with an example endpoint would appear as follows `curl https://docs-test-001.openai.azure.com/openai/deployments/{YOUR-DEPLOYMENT_NAME_HERE}/completions?api-version=2024-02-01 \`. If you encounter an error double check to make sure that you don't have a doubling of the `/` at the separation between your endpoint and `/openai/deployments`.
5959

6060
If you want to run this command in a normal Windows command prompt you would need to alter the text to remove the `\` and line breaks.
6161

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Run the following command. You need to replace `YourDeploymentName` with the dep
1818
$openai = @{
1919
api_key = $Env:AZURE_OPENAI_API_KEY
2020
api_base = $Env:AZURE_OPENAI_ENDPOINT # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
21-
api_version = '2023-09-01-preview' # this may change in the future
21+
api_version = '2024-02-01' # this may change in the future
2222
name = 'YourDeploymentName' #This will correspond to the custom name you chose for your deployment when you deployed a model.
2323
}
2424

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
services: ai-services
3-
author: soferreira
4-
ms.author: soferreira
3+
author: mrbullwinkle
4+
ms.author: mbullwin
55
ms.service: openai
66
ms.topic: include
77
ms.date: 1/25/2024
@@ -11,7 +11,7 @@ ms.date: 1/25/2024
1111

1212
### Prerequisites
1313

14-
- <a href="https://www.python.org/" target="_blank">Python 3.7.1 or later version</a>
14+
- <a href="https://www.python.org/" target="_blank">Python 3.8 or later version</a>
1515
- The following Python libraries: os
1616

1717
### Set up
@@ -44,7 +44,7 @@ import os
4444
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
4545
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
4646
openai.api_type = "azure"
47-
openai.api_version = "2023-09-01-preview"
47+
openai.api_version = "2024-02-01"
4848

4949
model_name = "whisper"
5050
deployment_id = "YOUR-DEPLOYMENT-NAME-HERE" #This will correspond to the custom name you chose for your deployment when you deployed a model."

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ author: eric-urban
1414
In a bash shell, run the following command. You need to replace `YourDeploymentName` with the deployment name you chose when you deployed the Whisper model. The deployment name isn't necessarily the same as the model name. Entering the model name results in an error unless you chose a deployment name that is identical to the underlying model name.
1515

1616
```bash
17-
curl $AZURE_OPENAI_ENDPOINT/openai/deployments/YourDeploymentName/audio/transcriptions?api-version=2023-09-01-preview \
17+
curl $AZURE_OPENAI_ENDPOINT/openai/deployments/YourDeploymentName/audio/transcriptions?api-version=2024-02-01 \
1818
-H "api-key: $AZURE_OPENAI_API_KEY" \
1919
-H "Content-Type: multipart/form-data" \
2020
-F file="@./wikipediaOcelot.wav"
2121
```
2222

23-
The format of your first line of the command with an example endpoint would appear as follows `curl https://aoai-docs.openai.azure.com/openai/deployments/{YourDeploymentName}/audio/transcriptions?api-version=2023-09-01-preview \`.
23+
The format of your first line of the command with an example endpoint would appear as follows `curl https://aoai-docs.openai.azure.com/openai/deployments/{YourDeploymentName}/audio/transcriptions?api-version=2024-02-01 \`.
2424

2525
You can get sample audio files from the [Azure AI Speech SDK repository at GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/sampledata/audiofiles).
2626

0 commit comments

Comments
 (0)