diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs index ba739dac..59ce88c2 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs @@ -40,10 +40,10 @@ public partial class ConversationService routing.Context.Push(agent.Id, reason: "request started"); // Save payload in order to assign the payload before hook is invoked - // if (replyMessage != null && !string.IsNullOrEmpty(replyMessage.Payload)) - // { - // message.Payload = replyMessage.Payload; - // } + if (replyMessage != null && !string.IsNullOrEmpty(replyMessage.Payload)) + { + message.Payload = replyMessage.Payload; + } // Before chat completion hook hooks = ReOrderConversationHooks(hooks); diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeFunction.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeFunction.cs index 499c8981..64b96136 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeFunction.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeFunction.cs @@ -53,7 +53,8 @@ public partial class RoutingService message.PostbackFunctionName = clonedMessage.PostbackFunctionName; message.CurrentAgentId = clonedMessage.CurrentAgentId; message.Content = clonedMessage.Content; - message.Payload = clonedMessage.Payload; + // Don't copy payload + // message.Payload = clonedMessage.Payload; message.StopCompletion = clonedMessage.StopCompletion; message.RichContent = clonedMessage.RichContent; message.Data = clonedMessage.Data;