Skip to content

Commit

Permalink
Fix the problem with chat history
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrandvd committed Dec 29, 2023
1 parent 5e5df20 commit 8141322
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/skUnit/Asserts/SemanticKernelAssert_Chat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ public async Task CheckChatScenarioAsync(Kernel kernel, ChatScenario scenario, F

if (chatItem.Role == AuthorRole.Assistant)
{
chatHistory.AddAssistantMessage(chatItem.Content);

Log($"## [EXPECTED ANSWER]");
Log(chatItem.Content);
Log();
Expand All @@ -88,7 +86,13 @@ public async Task CheckChatScenarioAsync(Kernel kernel, ChatScenario scenario, F
""");
}


var answer = await getAnswerFunc(chatHistory);

// To let chatHistory stay clean for gettig the answer
chatHistory.AddAssistantMessage(chatItem.Content);


Log($"### [ACTUAL ANSWER]");
Log(answer);
Log();
Expand Down

0 comments on commit 8141322

Please sign in to comment.