semantic-kernel
semantic-kernel copied to clipboard
.Net: The method for adding a message for AgentGroupChat should align with ChatHistory
For ChatHistory, to add the message, you do this:
history.AddMessage(
AuthorRole.User,
Console.ReadLine()!
);
For AgentGroupChat, to add the message, you do this:
chat.AddChatMessage(new ChatMessageContent(AuthorRole.User, Console.ReadLine()!));
Ideally AgentGroupChat aligns on AddMessage that accepts the role and message.
This is the pattern Mark proposed on code-review. Apparently the ChatHistory.AddMessage() method you identified is extraneous (Toub); although, I'm not 100% clear on what changes are planned.
In that case, ChatHistory should have AddChatMessage. Either way, there should be some parallelism between the two.
The equivalent is the Add method on List: