From d0b86020138375a6e77ac589a2d6954beac6f360 Mon Sep 17 00:00:00 2001 From: Vallarasu4653 Date: Tue, 25 Mar 2025 12:42:06 +0530 Subject: [PATCH] update on SemanticKernel reference --- .../ChartGenerator/AIService/ChartsAIService.cs | 2 +- .../ChartGenerator/ViewModel/ChartViewModel.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChartGeneratorAISample/ChartGenerator/AIService/ChartsAIService.cs b/ChartGeneratorAISample/ChartGenerator/AIService/ChartsAIService.cs index d243170..19bbf65 100644 --- a/ChartGeneratorAISample/ChartGenerator/AIService/ChartsAIService.cs +++ b/ChartGeneratorAISample/ChartGenerator/AIService/ChartsAIService.cs @@ -115,7 +115,7 @@ internal async Task GetAnswerFromGPT(string userPrompt) { try { - if (IsCredentialValid && ChatHistory != null && Client != null) + if (IsCredentialValid && Client != null) { ChatHistory = string.Empty; // Add the system message and user message to the options diff --git a/ChartGeneratorAISample/ChartGenerator/ViewModel/ChartViewModel.cs b/ChartGeneratorAISample/ChartGenerator/ViewModel/ChartViewModel.cs index dd589ba..b1e73e3 100644 --- a/ChartGeneratorAISample/ChartGenerator/ViewModel/ChartViewModel.cs +++ b/ChartGeneratorAISample/ChartGenerator/ViewModel/ChartViewModel.cs @@ -21,7 +21,7 @@ public class ChartViewModel : INotifyPropertyChanged private bool isLoading; private ObservableCollection messages = new(); - private ChartAIService semanticKernalService = new(); + private ChartAIService openAIService = new(); public string? EntryText { @@ -269,7 +269,7 @@ public async Task ProcessUserRequest(string request) + "- Only plain text should be used; no need to specify 'json' above the data." + "- No additional content other than json data should be included!"; - var response = await semanticKernalService.GetAnswerFromGPT(prompt); + var response = await openAIService.GetAnswerFromGPT(prompt); return response.ToString(); } @@ -344,7 +344,7 @@ public async Task GetAIResponse(string query) + "- No additional content other than json data should be included!"; // Call the method to get the AI response - var response = await semanticKernalService.GetAnswerFromGPT(prompt); + var response = await openAIService.GetAnswerFromGPT(prompt); // Convert the response to a string (assuming the response has a ToString method) return response.ToString();