From 18da9ad865252291d4bec495e24fa10c392cb690 Mon Sep 17 00:00:00 2001 From: Mehran Davoudi Date: Wed, 3 Jan 2024 01:45:56 +0330 Subject: [PATCH] Fix the output for assistant. --- src/skUnit/Asserts/SemanticKernelAssert_Chat.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/skUnit/Asserts/SemanticKernelAssert_Chat.cs b/src/skUnit/Asserts/SemanticKernelAssert_Chat.cs index 0eee8b2..3f9d2b3 100644 --- a/src/skUnit/Asserts/SemanticKernelAssert_Chat.cs +++ b/src/skUnit/Asserts/SemanticKernelAssert_Chat.cs @@ -40,19 +40,21 @@ public async Task CheckChatScenarioAsync(Kernel kernel, ChatScenario scenario, F while (queue.Count > 0) { var chatItem = queue.Dequeue(); - Log($"## [{chatItem.Role.ToString().ToUpper()}]"); - Log(chatItem.Content); - Log(); + if (chatItem.Role == AuthorRole.System) { chatHistory.AddSystemMessage(chatItem.Content); - continue; - } - - if (chatItem.Role == AuthorRole.User) + Log($"## [{chatItem.Role.ToString().ToUpper()}]"); + Log(chatItem.Content); + Log(); + } + else if (chatItem.Role == AuthorRole.User) { chatHistory.AddUserMessage(chatItem.Content); + Log($"## [{chatItem.Role.ToString().ToUpper()}]"); + Log(chatItem.Content); + Log(); } else if (chatItem.Role == AuthorRole.Assistant) {