Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions SmartAIComboBox/SmartAIComboBox/AIService/ComboBoxAzureAIService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ComboBoxAzureAIService
private IChatCompletionService? _chatCompletion;

/// <summary>
/// The kernal
/// The kernel
/// </summary>
private Kernel? _kernel;

Expand Down Expand Up @@ -63,12 +63,12 @@ private async void ValidateCredential()
{
#region Azure OpenAI
// Use below method for Azure Open AI
this.GetAzureOpenAIKernal();
this.GetAzureOpenAIKernel();
#endregion

#region Google Gemini
// Use below method for Google Gemini
//this.GetGoogleGeminiAIKernal();
//this.GetGoogleGeminiAIKernel();
#endregion

bool isValidUri = Uri.TryCreate(endpoint, UriKind.Absolute, out _uriResult)
Expand All @@ -83,7 +83,7 @@ private async void ValidateCredential()
{
if (_chatHistory != null && _chatCompletion != null)
{
// test the semantic kernal with message.
// test the semantic kernel with message.
_chatHistory.AddSystemMessage("Hello, Test Check");
await _chatCompletion.GetChatMessageContentAsync(chatHistory: _chatHistory, kernel: _kernel);
}
Expand All @@ -99,20 +99,20 @@ private async void ValidateCredential()

#region Azure OpenAI
/// <summary>
/// To get the Azure open ai kernal method
/// To get the Azure open ai kernel method
/// </summary>
private void GetAzureOpenAIKernal()
private void GetAzureOpenAIKernel()
{
// Create the chat history
_chatHistory = new ChatHistory();
try
{
var builder = Kernel.CreateBuilder().AddAzureOpenAIChatCompletion(deploymentName, endpoint, key);

// Get the kernal from build
// Get the kernel from build
_kernel = builder.Build();

//Get the chat completions from kernal
//Get the chat completions from kernel
_chatCompletion = _kernel.GetRequiredService<IChatCompletionService>();
}
catch (Exception)
Expand All @@ -126,7 +126,7 @@ private void GetAzureOpenAIKernal()
/// <summary>
/// To get the google Gemini ai kermal
/// </summary>
private void GetGoogleGeminiAIKernal()
private void GetGoogleGeminiAIKernel()
{
// //First Add the below package to the application
// add package Microsoft.SemanticKernel.Connectors.Google
Expand All @@ -138,7 +138,7 @@ private void GetGoogleGeminiAIKernal()
// _kernelBuilder.AddGoogleAIGeminiChatCompletion(modelId: "NAME_OF_MODEL", apiKey: key);
// Kernel _kernel = _kernelBuilder.Build();

// //Get the chat completions from kernal
// //Get the chat completions from kernel
// _chatCompletion = _kernel.GetRequiredService<IChatCompletionService>();
}
#endregion
Expand Down