Skip to content

Commit

Permalink
.Net: Small fixes for examples (#4354)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

Fixed initialization of `AzureOpenAIChatCompletionService` in examples.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
  • Loading branch information
dmytrostruk committed Dec 18, 2023
1 parent 3eaa507 commit 3bb9630
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions dotnet/samples/KernelSyntaxExamples/Example17_ChatGPT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ private static async Task AzureOpenAIChatSampleAsync()
Console.WriteLine("======== Azure Open AI - ChatGPT ========");

AzureOpenAIChatCompletionService chatCompletionService = new(
TestConfiguration.AzureOpenAI.ChatDeploymentName,
TestConfiguration.AzureOpenAI.ChatModelId,
TestConfiguration.AzureOpenAI.Endpoint,
TestConfiguration.AzureOpenAI.ApiKey);
deploymentName: TestConfiguration.AzureOpenAI.ChatDeploymentName,
endpoint: TestConfiguration.AzureOpenAI.Endpoint,
apiKey: TestConfiguration.AzureOpenAI.ApiKey,
modelId: TestConfiguration.AzureOpenAI.ChatModelId);

await StartChatAsync(chatCompletionService);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ private static async Task AzureOpenAIChatStreamSampleAsync()
Console.WriteLine("======== Azure Open AI - ChatGPT Streaming ========");

AzureOpenAIChatCompletionService chatCompletionService = new(
TestConfiguration.AzureOpenAI.ChatDeploymentName,
TestConfiguration.AzureOpenAI.ChatModelId,
TestConfiguration.AzureOpenAI.Endpoint,
TestConfiguration.AzureOpenAI.ApiKey);
deploymentName: TestConfiguration.AzureOpenAI.ChatDeploymentName,
endpoint: TestConfiguration.AzureOpenAI.Endpoint,
apiKey: TestConfiguration.AzureOpenAI.ApiKey,
modelId: TestConfiguration.AzureOpenAI.ChatModelId);

await StartStreamingChatAsync(chatCompletionService);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ private static async Task AzureOpenAIMultiChatCompletionAsync()
Console.WriteLine("======== Azure OpenAI - Multiple Chat Completion ========");

AzureOpenAIChatCompletionService chatCompletionService = new(
TestConfiguration.AzureOpenAI.ChatDeploymentName,
TestConfiguration.AzureOpenAI.ChatModelId,
TestConfiguration.AzureOpenAI.Endpoint,
TestConfiguration.AzureOpenAI.ApiKey);
deploymentName: TestConfiguration.AzureOpenAI.ChatDeploymentName,
endpoint: TestConfiguration.AzureOpenAI.Endpoint,
apiKey: TestConfiguration.AzureOpenAI.ApiKey,
modelId: TestConfiguration.AzureOpenAI.ChatModelId);

await RunChatAsync(chatCompletionService);
}
Expand Down

0 comments on commit 3bb9630

Please sign in to comment.