diff --git a/sdk/openai/openai/MIGRATION.md b/sdk/openai/openai/MIGRATION.md index a7fe94e61e50..d2816aa997b4 100644 --- a/sdk/openai/openai/MIGRATION.md +++ b/sdk/openai/openai/MIGRATION.md @@ -69,7 +69,7 @@ Migrated code: ```typescript import { AzureOpenAI } from "openai"; const deployment = "Your Azure OpenAI deployment"; -const apiVersion = "2024-10-01-preview"; +const apiVersion = "2024-11-01-preview"; const options = { azureADTokenProvider, deployment, apiVersion } const client = new AzureOpenAI(options); ``` diff --git a/sdk/openai/openai/README.md b/sdk/openai/openai/README.md index 812c0b4be17b..c6164eaf8aa3 100644 --- a/sdk/openai/openai/README.md +++ b/sdk/openai/openai/README.md @@ -60,7 +60,7 @@ There are several ways to authenticate with the Azure OpenAI service and the rec import { AzureOpenAI } from "openai"; const deployment = "Your deployment name"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); ``` @@ -126,7 +126,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-4-1106-preview"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ stream: true, @@ -182,7 +182,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-35-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ messages: [ diff --git a/sdk/openai/openai/samples-dev/audioTranscription.ts b/sdk/openai/openai/samples-dev/audioTranscription.ts index 3967fe585993..3aec0e3312ff 100644 --- a/sdk/openai/openai/samples-dev/audioTranscription.ts +++ b/sdk/openai/openai/samples-dev/audioTranscription.ts @@ -26,7 +26,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "whisper-deployment"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.audio.transcriptions.create({ model: "", diff --git a/sdk/openai/openai/samples-dev/audioTranslation.ts b/sdk/openai/openai/samples-dev/audioTranslation.ts index 43bd5d3b5b39..b75add1c0bdc 100644 --- a/sdk/openai/openai/samples-dev/audioTranslation.ts +++ b/sdk/openai/openai/samples-dev/audioTranslation.ts @@ -26,7 +26,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "whisper-deployment"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.audio.translations.create({ model: "", diff --git a/sdk/openai/openai/samples-dev/batch.ts b/sdk/openai/openai/samples-dev/batch.ts index e86248923240..0356fc1f7f2d 100644 --- a/sdk/openai/openai/samples-dev/batch.ts +++ b/sdk/openai/openai/samples-dev/batch.ts @@ -22,7 +22,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-4-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const batchContent = `{ "custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": { "model": "${deployment}", "messages": [{ "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "What is 2+2?" }] } }`; diff --git a/sdk/openai/openai/samples-dev/chatCompletions.ts b/sdk/openai/openai/samples-dev/chatCompletions.ts index 2c30e298fc4f..2e09cd2a5cbc 100644 --- a/sdk/openai/openai/samples-dev/chatCompletions.ts +++ b/sdk/openai/openai/samples-dev/chatCompletions.ts @@ -22,7 +22,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-35-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.chat.completions.create({ messages: [ diff --git a/sdk/openai/openai/samples-dev/codeInterpreter.ts b/sdk/openai/openai/samples-dev/codeInterpreter.ts index 8e1d72331e40..d9a9657c717d 100644 --- a/sdk/openai/openai/samples-dev/codeInterpreter.ts +++ b/sdk/openai/openai/samples-dev/codeInterpreter.ts @@ -13,7 +13,7 @@ import { AzureOpenAI } from "openai"; import { getBearerTokenProvider, DefaultAzureCredential } from "@azure/identity"; export async function main() { - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; // Create AzureOpenAI client with Microsoft Entra ID const credential = new DefaultAzureCredential(); const scope = "https://cognitiveservices.azure.com/.default"; diff --git a/sdk/openai/openai/samples-dev/completions.ts b/sdk/openai/openai/samples-dev/completions.ts index 96b8ad641609..252f59dfdbab 100644 --- a/sdk/openai/openai/samples-dev/completions.ts +++ b/sdk/openai/openai/samples-dev/completions.ts @@ -24,7 +24,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "text-davinci-003"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.completions.create({ prompt, model: "", max_tokens: 128 }); diff --git a/sdk/openai/openai/samples-dev/embeddings.ts b/sdk/openai/openai/samples-dev/embeddings.ts index 590dd23677ec..214ba409c07b 100644 --- a/sdk/openai/openai/samples-dev/embeddings.ts +++ b/sdk/openai/openai/samples-dev/embeddings.ts @@ -24,7 +24,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const deployment = "text-embedding-3-large"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const embeddings = await client.embeddings.create({ input, model: "" }); diff --git a/sdk/openai/openai/samples-dev/images.ts b/sdk/openai/openai/samples-dev/images.ts index 2340f6316789..2991ffa7d33e 100644 --- a/sdk/openai/openai/samples-dev/images.ts +++ b/sdk/openai/openai/samples-dev/images.ts @@ -29,7 +29,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "dall-e-3"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const results = await client.images.generate({ prompt, model: "", n, size }); diff --git a/sdk/openai/openai/samples-dev/onYourData.ts b/sdk/openai/openai/samples-dev/onYourData.ts index 790846226863..565f2c253902 100644 --- a/sdk/openai/openai/samples-dev/onYourData.ts +++ b/sdk/openai/openai/samples-dev/onYourData.ts @@ -27,7 +27,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-4-1106-preview"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ stream: true, diff --git a/sdk/openai/openai/samples-dev/streamChatCompletions.ts b/sdk/openai/openai/samples-dev/streamChatCompletions.ts index 4f0eda948d6d..97c9069c95b3 100644 --- a/sdk/openai/openai/samples-dev/streamChatCompletions.ts +++ b/sdk/openai/openai/samples-dev/streamChatCompletions.ts @@ -22,7 +22,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-35-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ messages: [ diff --git a/sdk/openai/openai/samples-dev/streamChatCompletionsWithContentFilter.ts b/sdk/openai/openai/samples-dev/streamChatCompletionsWithContentFilter.ts index e7a6b7778120..5a2f4c74528e 100644 --- a/sdk/openai/openai/samples-dev/streamChatCompletionsWithContentFilter.ts +++ b/sdk/openai/openai/samples-dev/streamChatCompletionsWithContentFilter.ts @@ -23,7 +23,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-35-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ messages: [ diff --git a/sdk/openai/openai/samples-dev/streamCompletions.ts b/sdk/openai/openai/samples-dev/streamCompletions.ts index e99edbb87034..97a767dd3cdb 100644 --- a/sdk/openai/openai/samples-dev/streamCompletions.ts +++ b/sdk/openai/openai/samples-dev/streamCompletions.ts @@ -24,7 +24,7 @@ export async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "text-davinci-003"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.completions.create({ prompt, diff --git a/sdk/openai/openai/samples-dev/textToSpeech.ts b/sdk/openai/openai/samples-dev/textToSpeech.ts index 1fb740e910d3..16a4645b93fb 100644 --- a/sdk/openai/openai/samples-dev/textToSpeech.ts +++ b/sdk/openai/openai/samples-dev/textToSpeech.ts @@ -24,7 +24,7 @@ const speechFilePath = process.env["SPEECH_FILE_PATH"] || " { endpoint: process.env.AZURE_OPENAI_ENDPOINT, deployment: process.env.AZURE_OPENAI_DEPLOYMENT, azureADTokenProvider, - apiVersion: "2024-10-01-preview", + apiVersion: "2024-11-01-preview", }); const prompt = req.body.prompt; diff --git a/sdk/openai/openai/samples/cookbook/speechToSpeechChat/app.js b/sdk/openai/openai/samples/cookbook/speechToSpeechChat/app.js index ba4eaede37a9..ca384794810e 100644 --- a/sdk/openai/openai/samples/cookbook/speechToSpeechChat/app.js +++ b/sdk/openai/openai/samples/cookbook/speechToSpeechChat/app.js @@ -24,7 +24,7 @@ const openAI = new AzureOpenAI({ endpoint: process.env.AZURE_OPENAI_ENDPOINT, deployment: process.env.AZURE_OPENAI_DEPLOYMENT, azureADTokenProvider, - apiVersion: "2024-10-01-preview", + apiVersion: "2024-11-01-preview", }); app.get("/api/auth", async (req, res) => { diff --git a/sdk/openai/openai/samples/v2-beta/javascript/audioTranscription.js b/sdk/openai/openai/samples/v2-beta/javascript/audioTranscription.js index 320a75d48c40..5fba3bfc8fe9 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/audioTranscription.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/audioTranscription.js @@ -25,7 +25,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "whisper-deployment"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.audio.transcriptions.create({ model: "", diff --git a/sdk/openai/openai/samples/v2-beta/javascript/audioTranslation.js b/sdk/openai/openai/samples/v2-beta/javascript/audioTranslation.js index 89f7b6b79d37..13877f383763 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/audioTranslation.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/audioTranslation.js @@ -25,7 +25,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "whisper-deployment"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.audio.translations.create({ model: "", diff --git a/sdk/openai/openai/samples/v2-beta/javascript/batch.js b/sdk/openai/openai/samples/v2-beta/javascript/batch.js index 2d1d6b8de812..ccbc562b53a5 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/batch.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/batch.js @@ -21,7 +21,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-4-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const batchContent = `{ "custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": { "model": "${deployment}", "messages": [{ "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "What is 2+2?" }] } }`; diff --git a/sdk/openai/openai/samples/v2-beta/javascript/chatCompletions.js b/sdk/openai/openai/samples/v2-beta/javascript/chatCompletions.js index ee260eb7c284..9c72f3f1a73c 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/chatCompletions.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/chatCompletions.js @@ -21,7 +21,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-35-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.chat.completions.create({ messages: [ diff --git a/sdk/openai/openai/samples/v2-beta/javascript/codeInterpreter.js b/sdk/openai/openai/samples/v2-beta/javascript/codeInterpreter.js index 11b0e8cafe9e..14a5eed37258 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/codeInterpreter.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/codeInterpreter.js @@ -12,7 +12,7 @@ const { AzureOpenAI } = require("openai"); const { getBearerTokenProvider, DefaultAzureCredential } = require("@azure/identity"); async function main() { - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; // Create AzureOpenAI client with Microsoft Entra ID const credential = new DefaultAzureCredential(); const scope = "https://cognitiveservices.azure.com/.default"; diff --git a/sdk/openai/openai/samples/v2-beta/javascript/completions.js b/sdk/openai/openai/samples/v2-beta/javascript/completions.js index 6abb610a4bb8..2147e6b0373c 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/completions.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/completions.js @@ -23,7 +23,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "text-davinci-003"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const result = await client.completions.create({ prompt, model: "", max_tokens: 128 }); diff --git a/sdk/openai/openai/samples/v2-beta/javascript/embeddings.js b/sdk/openai/openai/samples/v2-beta/javascript/embeddings.js index 4dacd00a4f4c..d96401e45c4d 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/embeddings.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/embeddings.js @@ -23,7 +23,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const deployment = "text-embedding-3-large"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const embeddings = await client.embeddings.create({ input, model: "" }); diff --git a/sdk/openai/openai/samples/v2-beta/javascript/images.js b/sdk/openai/openai/samples/v2-beta/javascript/images.js index 4714df775a2c..e6afa55a13c7 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/images.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/images.js @@ -28,7 +28,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "dall-e-3"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const results = await client.images.generate({ prompt, model: "", n, size }); diff --git a/sdk/openai/openai/samples/v2-beta/javascript/onYourData.js b/sdk/openai/openai/samples/v2-beta/javascript/onYourData.js index 1a044ac34f7b..bcdbcedacd1e 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/onYourData.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/onYourData.js @@ -25,7 +25,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-4-1106-preview"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ stream: true, diff --git a/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletions.js b/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletions.js index 3a1dafb3b817..7c91694dbf7e 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletions.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletions.js @@ -21,7 +21,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-35-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ messages: [ diff --git a/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletionsWithContentFilter.js b/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletionsWithContentFilter.js index f5ee14634e5a..1485a1baef1b 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletionsWithContentFilter.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/streamChatCompletionsWithContentFilter.js @@ -21,7 +21,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "gpt-35-turbo"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.chat.completions.create({ messages: [ diff --git a/sdk/openai/openai/samples/v2-beta/javascript/streamCompletions.js b/sdk/openai/openai/samples/v2-beta/javascript/streamCompletions.js index c914864d6cb8..954892ea3984 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/streamCompletions.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/streamCompletions.js @@ -23,7 +23,7 @@ async function main() { const scope = "https://cognitiveservices.azure.com/.default"; const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope); const deployment = "text-davinci-003"; - const apiVersion = "2024-10-01-preview"; + const apiVersion = "2024-11-01-preview"; const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion }); const events = await client.completions.create({ prompt, diff --git a/sdk/openai/openai/samples/v2-beta/javascript/textToSpeech.js b/sdk/openai/openai/samples/v2-beta/javascript/textToSpeech.js index 5533a583f093..eb2d4d7d0b13 100644 --- a/sdk/openai/openai/samples/v2-beta/javascript/textToSpeech.js +++ b/sdk/openai/openai/samples/v2-beta/javascript/textToSpeech.js @@ -23,7 +23,7 @@ const speechFilePath = process.env["SPEECH_FILE_PATH"] || "