Merge pull request #367 from hchen2020/master

Not trigger if replyMessage.FunctionName is empty.
This commit is contained in:
C. Oceania 2024-03-27 11:58:02 -05:00 committed by GitHub
commit be958beba0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -48,6 +48,9 @@ public class RoleDialogModel : ITrackableMessage
[JsonIgnore(Condition = JsonIgnoreCondition.Always)]
public string ImageUrl { get; set; }
/// <summary>
/// Remember to set Message.Content as well
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public RichContent<IRichMessage>? RichContent { get; set; }

View file

@ -53,7 +53,7 @@ public partial class ConversationService
hook.SetAgent(agent)
.SetConversation(conversation);
if (replyMessage == null)
if (replyMessage == null || string.IsNullOrEmpty(replyMessage.FunctionName))
{
await hook.OnMessageReceived(message);
}