From f32773c213a2bbd274f4c26d0481ff4346c107a6 Mon Sep 17 00:00:00 2001 From: subash_s Date: Wed, 5 Nov 2025 18:44:15 +0530 Subject: [PATCH] ai prompt updated --- .../AISalesDashboard/Service/PredictionService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AISalesDashboard/AISalesDashboard/Service/PredictionService.cs b/AISalesDashboard/AISalesDashboard/Service/PredictionService.cs index 9df167c..3c33e02 100644 --- a/AISalesDashboard/AISalesDashboard/Service/PredictionService.cs +++ b/AISalesDashboard/AISalesDashboard/Service/PredictionService.cs @@ -33,7 +33,15 @@ public async Task> GetSalesPredictionsAsync( internal async Task GetRandomExplanationAsync(List predictions) { - string prompt = $"Based on the {predictions.Count} sales data points, provide an insightful explanation."; + var fullData = predictions + .Select(p => + $"Date: {p.Date:yyyy-MM-dd}, Revenue: {p.PredictedRevenue}, Confidence: {p.Confidence}, Anomaly: {p.IsAnomaly}, AnomalyExplanation: {p.AnomalyExplanation ?? "N/A"}") + .ToList(); + + string dataText = string.Join("\n", fullData); + + string prompt = $@"You are analyzing {predictions.Count} sales predictions. Here is the full data: {dataText} + Based on this data, provide an insightful explanation."; string insights = await _baseAIService.GetAnswerFromGPT(prompt);