From 5699842b49f0c0eedcc286114c8b9fe977d80939 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Fri, 10 May 2024 18:27:41 -0500 Subject: [PATCH] Save payload only when it's not empty. --- .../Conversations/Services/ConversationService.SendMessage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs index 489e400e..d6940fe1 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs @@ -52,9 +52,9 @@ public partial class ConversationService message.Files?.Clear(); // Save payload - if (replyMessage != null) + if (replyMessage != null && !string.IsNullOrEmpty(replyMessage.Payload)) { - message.Payload = string.IsNullOrEmpty(replyMessage.Payload) ? message.Content : replyMessage.Payload; + message.Payload = replyMessage.Payload; } // Before chat completion hook