Skip to content

Commit 034cb56

Browse files
committed
fix: keep Azure image API version default
1 parent 30426ef commit 034cb56

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

docs/providers/openai.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,10 +787,10 @@ Set `AZURE_OPENAI_API_VERSION` to pin a specific Azure preview or GA version
787787
for the Azure image-generation path:
788788

789789
```bash
790-
export AZURE_OPENAI_API_VERSION="preview"
790+
export AZURE_OPENAI_API_VERSION="2024-12-01-preview"
791791
```
792792

793-
The default is `preview` when the variable is unset.
793+
The default is `2024-12-01-preview` when the variable is unset.
794794

795795
### Model names are deployment names
796796

extensions/openai/image-generation-provider.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ describe("openai image generation provider", () => {
12961296

12971297
expect(httpConfigCall().defaultHeaders).toEqual({ "api-key": "openai-key" });
12981298
expect(jsonRequestCall().url).toBe(
1299-
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=preview",
1299+
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=2024-12-01-preview",
13001300
);
13011301
});
13021302

@@ -1321,7 +1321,7 @@ describe("openai image generation provider", () => {
13211321
});
13221322

13231323
expect(jsonRequestCall().url).toBe(
1324-
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2-1/images/generations?api-version=preview",
1324+
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2-1/images/generations?api-version=2024-12-01-preview",
13251325
);
13261326
expect(jsonRequestCall().body).toEqual({
13271327
prompt: "Azure cat",
@@ -1382,7 +1382,7 @@ describe("openai image generation provider", () => {
13821382
});
13831383

13841384
expect(jsonRequestCall().url).toBe(
1385-
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=preview",
1385+
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=2024-12-01-preview",
13861386
);
13871387
expect(jsonRequestCall().body).toEqual({
13881388
prompt: "Transparent Azure sticker",
@@ -1415,7 +1415,7 @@ describe("openai image generation provider", () => {
14151415

14161416
expect(httpConfigCall().defaultHeaders).toEqual({ "api-key": "openai-key" });
14171417
expect(jsonRequestCall().url).toBe(
1418-
"https://myresource.cognitiveservices.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=preview",
1418+
"https://myresource.cognitiveservices.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=2024-12-01-preview",
14191419
);
14201420
});
14211421

@@ -1441,7 +1441,7 @@ describe("openai image generation provider", () => {
14411441

14421442
expect(httpConfigCall().defaultHeaders).toEqual({ "api-key": "openai-key" });
14431443
expect(jsonRequestCall().url).toBe(
1444-
"https://my-resource.services.ai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=preview",
1444+
"https://my-resource.services.ai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=2024-12-01-preview",
14451445
);
14461446
});
14471447

@@ -1499,7 +1499,7 @@ describe("openai image generation provider", () => {
14991499
});
15001500

15011501
expect(multipartRequestCall().url).toBe(
1502-
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/edits?api-version=preview",
1502+
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/edits?api-version=2024-12-01-preview",
15031503
);
15041504
expect(multipartRequestCall().body).toBeInstanceOf(FormData);
15051505
});
@@ -1560,7 +1560,7 @@ describe("openai image generation provider", () => {
15601560
});
15611561

15621562
expect(jsonRequestCall().url).toBe(
1563-
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=preview",
1563+
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=2024-12-01-preview",
15641564
);
15651565
});
15661566

@@ -1585,7 +1585,7 @@ describe("openai image generation provider", () => {
15851585
});
15861586

15871587
expect(jsonRequestCall().url).toBe(
1588-
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=preview",
1588+
"https://myresource.openai.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=2024-12-01-preview",
15891589
);
15901590
});
15911591

extensions/openai/image-generation-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const AZURE_HOSTNAME_SUFFIXES = [
7575
".cognitiveservices.azure.com",
7676
] as const;
7777

78-
const DEFAULT_AZURE_OPENAI_API_VERSION = "preview";
78+
const DEFAULT_AZURE_OPENAI_API_VERSION = "2024-12-01-preview";
7979

8080
function sanitizeLogValue(value: unknown): string {
8181
const raw =

0 commit comments

Comments
 (0)