From 3a8322eae09949f02e0da5faf3675c6eaba4a63b Mon Sep 17 00:00:00 2001 From: Quentin Tresontani Date: Thu, 22 Jan 2026 12:59:17 +0100 Subject: [PATCH] [Agent] Distinguish the different types of feedback --- .../Internal/AgentUserFeedback.Codeunit.al | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/System Application/App/Agent/Interaction/Internal/AgentUserFeedback.Codeunit.al b/src/System Application/App/Agent/Interaction/Internal/AgentUserFeedback.Codeunit.al index 2ae7431bf5..678b78fcf4 100644 --- a/src/System Application/App/Agent/Interaction/Internal/AgentUserFeedback.Codeunit.al +++ b/src/System Application/App/Agent/Interaction/Internal/AgentUserFeedback.Codeunit.al @@ -78,12 +78,27 @@ codeunit 4329 "Agent User Feedback" end; [Scope('OnPrem')] - procedure RequestFeedback(FeatureName: Text; ContextProperties: Dictionary of [Text, Text]) + procedure RequestFeedback(FeatureName: Text; Context: Dictionary of [Text, Text]) var MicrosoftUserFeedback: Codeunit "Microsoft User Feedback"; EmptyContextFiles: Dictionary of [Text, Text]; + FeedbackType: Text; + CopilotThumbsUpTok: Label 'Copilot.ThumbsUp', Locked = true; + CopilotThumbsDownTok: Label 'Copilot.ThumbsDown', Locked = true; + FeedbackTypeTok: Label 'Feedback.Type', Locked = true; begin MicrosoftUserFeedback.SetIsAIFeedback(true); - MicrosoftUserFeedback.RequestFeedback(FeatureName, AgentFeatureAreaTok, AgentFeatureDisplayNameTok, EmptyContextFiles, ContextProperties); + + if Context.ContainsKey(FeedbackTypeTok) then + FeedbackType := Context.Get(FeedbackTypeTok); + + case FeedbackType of + CopilotThumbsUpTok: + MicrosoftUserFeedback.RequestLikeFeedback(FeatureName, AgentFeatureAreaTok, AgentFeatureDisplayNameTok, EmptyContextFiles, Context); + CopilotThumbsDownTok: + MicrosoftUserFeedback.RequestDislikeFeedback(FeatureName, AgentFeatureAreaTok, AgentFeatureDisplayNameTok, EmptyContextFiles, Context); + else + MicrosoftUserFeedback.RequestFeedback(FeatureName, AgentFeatureAreaTok, AgentFeatureDisplayNameTok, EmptyContextFiles, Context); + end; end; } \ No newline at end of file