Update ConversationService.SendMessage.cs

This commit is contained in:
C. Oceania 2024-05-07 17:23:17 -05:00 committed by GitHub
parent d8c2e1dced
commit 2a5d0ac4ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,7 +52,10 @@ public partial class ConversationService
message.Files?.Clear();
// Save payload
message.Payload = string.IsNullOrEmpty(replyMessage.Payload) ? message.Content : replyMessage.Payload;
if (replyMessage != null)
{
message.Payload = string.IsNullOrEmpty(replyMessage.Payload) ? message.Content : replyMessage.Payload;
}
// Before chat completion hook
foreach (var hook in hooks)