Skip to content

Commit 117e241

Browse files
authored
Merge pull request #270654 from mrbullwinkle/mrb_03_29_2024_API_updates
[Azure OpenAI] [Bulk update] Increment API versions
2 parents a2946e8 + b6fec93 commit 117e241

18 files changed

+61
-57
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ main().catch((err) => {
640640
$openai = @{
641641
api_key = $Env:AZURE_OPENAI_API_KEY
642642
api_base = $Env:AZURE_OPENAI_ENDPOINT # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
643-
api_version = '2023-10-01-preview' # this may change in the future
643+
api_version = '2024-03-01-preview' # this may change in the future
644644
name = 'YOUR-DEPLOYMENT-NAME-HERE' #This will correspond to the custom name you chose for your deployment when you deployed a model.
645645
}
646646

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To obtain an embedding vector for a piece of text, we make a request to the embe
2323

2424
# [console](#tab/console)
2525
```console
26-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings?api-version=2023-05-15\
26+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings?api-version=2024-02-01\
2727
-H 'Content-Type: application/json' \
2828
-H 'api-key: YOUR_API_KEY' \
2929
-d '{"input": "Sample Document goes here"}'
@@ -37,7 +37,7 @@ from openai import AzureOpenAI
3737

3838
client = AzureOpenAI(
3939
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
40-
api_version = "2023-05-15",
40+
api_version = "2024-02-01",
4141
azure_endpoint =os.getenv("AZURE_OPENAI_ENDPOINT")
4242
)
4343

@@ -59,7 +59,7 @@ import openai
5959
openai.api_type = "azure"
6060
openai.api_key = YOUR_API_KEY
6161
openai.api_base = "https://YOUR_RESOURCE_NAME.openai.azure.com"
62-
openai.api_version = "2023-05-15"
62+
openai.api_version = "2024-02-01"
6363

6464
response = openai.Embedding.create(
6565
input="Your text string goes here",
@@ -101,7 +101,7 @@ foreach (float item in returnValue.Value.Data[0].Embedding.ToArray())
101101
$openai = @{
102102
api_key = $Env:AZURE_OPENAI_API_KEY
103103
api_base = $Env:AZURE_OPENAI_ENDPOINT # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
104-
api_version = '2023-05-15' # this may change in the future
104+
api_version = '2024-02-01' # this may change in the future
105105
name = 'YOUR-DEPLOYMENT-NAME-HERE' #This will correspond to the custom name you chose for your deployment when you deployed a model.
106106
}
107107

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ Parallel function calls are supported with:
3131
### Supported models
3232

3333
* `gpt-35-turbo` (1106)
34-
* `gpt-4` (1106-preview)
34+
* `gpt-35-turbo` (0125)
35+
* `gpt-4` (1106-Preview)
36+
* `gpt-4` (0125-Preview)
3537

36-
### Supported API versions
38+
### API support
3739

38-
* [`2023-12-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview/inference.json)
40+
Support for parallel function was first added in API version [`2023-12-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview/inference.json)
3941

4042
Parallel function calls allow you to perform multiple function calls together, allowing for parallel execution and retrieval of results. This reduces the number of calls to the API that need to be made and can improve overall performance.
4143

@@ -58,7 +60,7 @@ import json
5860
client = AzureOpenAI(
5961
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
6062
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
61-
api_version="2023-12-01-preview"
63+
api_version="2024-03-01-preview"
6264
)
6365

6466

articles/ai-services/openai/how-to/json-mode.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ JSON mode is only currently supported with the following models:
2323

2424
### Supported models
2525

26-
- `gpt-4-1106-preview` ([region availability](../concepts/models.md#gpt-4-and-gpt-4-turbo-preview-model-availability))
27-
- `gpt-35-turbo-1106` ([region availability)](../concepts/models.md#gpt-35-turbo-model-availability))
26+
* `gpt-35-turbo` (1106)
27+
* `gpt-35-turbo` (0125)
28+
* `gpt-4` (1106-Preview)
29+
* `gpt-4` (0125-Preview)
2830

29-
### API version
31+
### API support
3032

31-
- `2023-12-01-preview`
33+
Support for JSON mode was first added in API version [`2023-12-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview/inference.json)
3234

3335
## Example
3436

@@ -41,11 +43,11 @@ from openai import AzureOpenAI
4143
client = AzureOpenAI(
4244
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
4345
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
44-
api_version="2023-12-01-preview"
46+
api_version="2024-03-01-preview"
4547
)
4648

4749
response = client.chat.completions.create(
48-
model="gpt-4-1106-preview", # Model = should match the deployment name you chose for your 1106-preview model deployment
50+
model="gpt-4-0125-Preview", # Model = should match the deployment name you chose for your 0125-Preview model deployment
4951
response_format={ "type": "json_object" },
5052
messages=[
5153
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
@@ -74,7 +76,7 @@ because they plan to use the output for further scripting.
7476
$openai = @{
7577
api_key = $Env:AZURE_OPENAI_API_KEY
7678
api_base = $Env:AZURE_OPENAI_ENDPOINT # like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
77-
api_version = '2023-12-01-preview' # may change in the future
79+
api_version = '2024-03-01-preview' # may change in the future
7880
name = 'YOUR-DEPLOYMENT-NAME-HERE' # name you chose for your deployment
7981
}
8082

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ from openai import AzureOpenAI
7070
client = AzureOpenAI(
7171
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
7272
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
73-
api_version="2023-05-15"
73+
api_version="2024-02-01"
7474
)
7575

7676
response = client.chat.completions.create(
@@ -98,7 +98,7 @@ import openai
9898
openai.api_type = "azure"
9999
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
100100
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
101-
openai.api_version = "2023-05-15"
101+
openai.api_version = "2024-02-01"
102102

103103
response = openai.ChatCompletion.create(
104104
engine="gpt-35-turbo", # engine = "deployment_name".
@@ -126,7 +126,7 @@ from openai import AzureOpenAI
126126

127127
client = AzureOpenAI(
128128
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
129-
api_version="2023-12-01-preview",
129+
api_version="2024-02-01",
130130
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
131131
)
132132

@@ -148,7 +148,7 @@ import openai
148148
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
149149
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
150150
openai.api_type = 'azure'
151-
openai.api_version = '2023-05-15' # this might change in the future
151+
openai.api_version = '2024-02-01' # this might change in the future
152152

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

@@ -172,7 +172,7 @@ from openai import AzureOpenAI
172172

173173
client = AzureOpenAI(
174174
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
175-
api_version = "2023-05-15",
175+
api_version = "2024-02-01",
176176
azure_endpoint =os.getenv("AZURE_OPENAI_ENDPOINT")
177177
)
178178

@@ -194,7 +194,7 @@ import openai
194194
openai.api_type = "azure"
195195
openai.api_key = YOUR_API_KEY
196196
openai.api_base = "https://YOUR_RESOURCE_NAME.openai.azure.com"
197-
openai.api_version = "2023-05-15"
197+
openai.api_version = "2024-02-01"
198198

199199
response = openai.Embedding.create(
200200
input="Your text string goes here",
@@ -218,7 +218,7 @@ from openai import AsyncAzureOpenAI
218218
async def main():
219219
client = AsyncAzureOpenAI(
220220
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
221-
api_version = "2023-12-01-preview",
221+
api_version = "2024-02-01",
222222
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
223223
)
224224
response = await client.chat.completions.create(model="gpt-35-turbo", messages=[{"role": "user", "content": "Hello world"}])
@@ -236,7 +236,7 @@ from openai import AzureOpenAI
236236

237237
token_provider = get_bearer_token_provider(DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default")
238238

239-
api_version = "2023-12-01-preview"
239+
api_version = "2024-02-01"
240240
endpoint = "https://my-resource.openai.azure.com"
241241

242242
client = AzureOpenAI(

articles/ai-services/openai/how-to/provisioned-get-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The inferencing code for provisioned deployments is the same a standard deployme
7979
client = AzureOpenAI(
8080
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
8181
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
82-
api_version="2023-05-15"
82+
api_version="2024-02-01"
8383
)
8484

8585
response = client.chat.completions.create(
@@ -139,7 +139,7 @@ from openai import AzureOpenAI
139139
client = AzureOpenAI(
140140
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
141141
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
142-
api_version="2023-05-15",
142+
api_version="2024-02-01",
143143
max_retries=5,# default is 2
144144
)
145145

articles/ai-services/openai/how-to/use-blocklists.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Copy the cURL command below to a text editor and make the following changes:
4747
1. Optionally replace the value of the "description" field with a custom description.
4848

4949
```bash
50-
curl --location --request PUT 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}?api-version=2023-10-01-preview' \
50+
curl --location --request PUT 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}?api-version=2024-03-01-preview' \
5151
--header 'Authorization: Bearer {token}' \
5252
--header 'Content-Type: application/json' \
5353
--data-raw '{
@@ -73,7 +73,7 @@ To apply a **completion** blocklist to a content filter, use the following cURL
7373
1. Replace "raiBlocklistName" in the body with a custom name for your list. Allowed characters: `0-9, A-Z, a-z, - . _ ~`.
7474

7575
```bash
76-
curl --location --request PUT 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}?api-version=2023-10-01-preview' \
76+
curl --location --request PUT 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}?api-version=2024-03-01-preview' \
7777
--header 'Authorization: Bearer {token}' \
7878
--header 'Content-Type: application/json' \
7979
--data-raw '{
@@ -103,7 +103,7 @@ Copy the cURL command below to a text editor and make the following changes:
103103
1. Replace the value of the `"blocking pattern"` field with the item you'd like to add to your blocklist. The maximum length of a blockItem is 1000 characters. Also specify whether the pattern is regex or exact match.
104104

105105
```bash
106-
curl --location --request PUT 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}?api-version=2023-10-01-preview' \
106+
curl --location --request PUT 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}?api-version=2024-03-01-preview' \
107107
--header 'Authorization: Bearer {token}' \
108108
--header 'Content-Type: application/json' \
109109
--data-raw '{

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ from openai import AzureOpenAI
2424

2525
client = AzureOpenAI(
2626
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
27-
api_version = "2023-05-15",
27+
api_version = "2024-02-01",
2828
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
2929
)
3030

@@ -116,7 +116,7 @@ Microsoft was founded by Bill Gates and Paul Allen. They established the company
116116
import os
117117
import openai
118118
openai.api_type = "azure"
119-
openai.api_version = "2023-05-15"
119+
openai.api_version = "2024-02-01"
120120
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
121121
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
122122

@@ -314,7 +314,7 @@ from openai import AzureOpenAI
314314

315315
client = AzureOpenAI(
316316
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
317-
api_version = "2023-05-15",
317+
api_version = "2024-02-01",
318318
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
319319
)
320320

@@ -340,7 +340,7 @@ while True:
340340
import os
341341
import openai
342342
openai.api_type = "azure"
343-
openai.api_version = "2023-05-15"
343+
openai.api_version = "2024-02-01"
344344
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
345345
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
346346

@@ -385,7 +385,7 @@ from openai import AzureOpenAI
385385

386386
client = AzureOpenAI(
387387
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
388-
api_version = "2023-05-15",
388+
api_version = "2024-02-01",
389389
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
390390
)
391391

@@ -464,7 +464,7 @@ import openai
464464
import os
465465

466466
openai.api_type = "azure"
467-
openai.api_version = "2023-05-15"
467+
openai.api_version = "2024-02-01"
468468
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
469469
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
470470

articles/ai-services/openai/includes/chat-markup-language.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import os
2323
import openai
2424
openai.api_type = "azure"
2525
openai.api_base = "https://{your-resource-name}.openai.azure.com/"
26-
openai.api_version = "2023-05-15"
26+
openai.api_version = "2024-02-01"
2727
openai.api_key = os.getenv("OPENAI_API_KEY")
2828

2929
response = openai.Completion.create(
@@ -220,7 +220,7 @@ import os
220220
import openai
221221
openai.api_type = "azure"
222222
openai.api_base = "https://{your-resource-name}.openai.azure.com/" #This corresponds to your Azure OpenAI resource's endpoint value
223-
openai.api_version = "2023-05-15"
223+
openai.api_version = "2024-02-01"
224224
openai.api_key = os.getenv("OPENAI_API_KEY")
225225

226226
# defining a function to create the prompt from the system message and the conversation messages

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ echo export AZURE_OPENAI_ENDPOINT="REPLACE_WITH_YOUR_ENDPOINT_HERE" >> /etc/envi
7676
$openai = @{
7777
api_key = $Env:AZURE_OPENAI_API_KEY
7878
api_base = $Env:AZURE_OPENAI_ENDPOINT # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
79-
api_version = '2023-05-15' # this may change in the future
79+
api_version = '2024-02-01' # this may change in the future
8080
name = 'YOUR-DEPLOYMENT-NAME-HERE' #This will correspond to the custom name you chose for your deployment when you deployed a model.
8181
}
8282

0 commit comments

Comments
 (0)