diff --git a/Instructions/Exercises/02-natural-language-azure-openai.md b/Instructions/Exercises/02-natural-language-azure-openai.md index 312ae2ff..a23ea796 100644 --- a/Instructions/Exercises/02-natural-language-azure-openai.md +++ b/Instructions/Exercises/02-natural-language-azure-openai.md @@ -112,19 +112,18 @@ Now you're ready to use the Azure OpenAI SDK to consume your deployed model. // Build completion options object ChatCompletionsOptions chatCompletionsOptions = new ChatCompletionsOptions() { - Messages = - { - new ChatMessage(ChatRole.System, "You are a helpful assistant."), - new ChatMessage(ChatRole.User, "Summarize the following text in 20 words or less:\n" + text), - }, - MaxTokens = 120, - Temperature = 0.7f, + Messages = + { + new ChatMessage(ChatRole.System, "You are a helpful assistant."), + new ChatMessage(ChatRole.User, "Summarize the following text in 20 words or less:\n" + text), + }, + MaxTokens = 120, + Temperature = 0.7f, + DeploymentName = oaiModelName }; // Send request to Azure OpenAI model - ChatCompletions response = client.GetChatCompletions( - deploymentOrModelName: oaiModelName, - chatCompletionsOptions); + ChatCompletions response = client.GetChatCompletions(chatCompletionsOptions); string completion = response.Choices[0].Message.Content; Console.WriteLine("Summary: " + completion + "\n"); diff --git a/Instructions/Exercises/03-prompt-engineering.md b/Instructions/Exercises/03-prompt-engineering.md index a807a6b4..dbcf8dc0 100644 --- a/Instructions/Exercises/03-prompt-engineering.md +++ b/Instructions/Exercises/03-prompt-engineering.md @@ -249,13 +249,11 @@ Now you're ready to use the Azure OpenAI SDK to consume your deployed model. }, Temperature = 0.7f, MaxTokens = 800, + DeploymentName = oaiModelName }; // Get response from Azure OpenAI - Response response = await client.GetChatCompletionsAsync( - oaiModelName, - chatCompletionsOptions - ); + Response response = await client.GetChatCompletionsAsync(chatCompletionsOptions); ChatCompletions completions = response.Value; string completion = completions.Choices[0].Message.Content; diff --git a/Instructions/Exercises/04-code-generation.md b/Instructions/Exercises/04-code-generation.md index 8707ebc9..7676b70b 100644 --- a/Instructions/Exercises/04-code-generation.md +++ b/Instructions/Exercises/04-code-generation.md @@ -197,13 +197,11 @@ Now you're ready to use the Azure OpenAI SDK to consume your deployed model. }, Temperature = 0.7f, MaxTokens = 1000, + DeploymentName = oaiModelName }; // Get response from Azure OpenAI - Response response = await client.GetChatCompletionsAsync( - oaiModelName, - chatCompletionsOptions - ); + Response response = await client.GetChatCompletionsAsync(chatCompletionsOptions); ChatCompletions completions = response.Value; string completion = completions.Choices[0].Message.Content; diff --git a/Labfiles/06-use-own-data/CSharp/OwnData.cs b/Labfiles/06-use-own-data/CSharp/OwnData.cs index 79137528..6764b627 100644 --- a/Labfiles/06-use-own-data/CSharp/OwnData.cs +++ b/Labfiles/06-use-own-data/CSharp/OwnData.cs @@ -36,6 +36,7 @@ }, MaxTokens = 600, Temperature = 0.9f, + DeploymentName = oaiModelName AzureExtensionsOptions = new AzureChatExtensionsOptions() { Extensions = @@ -51,9 +52,7 @@ }; // Send request to Azure OpenAI model (Add code here) -ChatCompletions response = client.GetChatCompletions( - deploymentOrModelName: oaiModelName, - chatCompletionsOptions); +ChatCompletions response = client.GetChatCompletions(chatCompletionsOptions); ChatMessage responseMessage = response.Choices[0].Message;