semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: The method for adding a message for AgentGroupChat should align with ChatHistory

Open madsbolaris opened this issue 1 year ago • 3 comments

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.

madsbolaris avatar Apr 29 '24 18:04 madsbolaris

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.

crickman avatar Apr 29 '24 21:04 crickman

In that case, ChatHistory should have AddChatMessage. Either way, there should be some parallelism between the two.

madsbolaris avatar Apr 29 '24 21:04 madsbolaris

The equivalent is the Add method on List:

image

crickman avatar Apr 29 '24 21:04 crickman