Skip to content

Commit

Permalink
.Net: Integration tests improvements (#5981)
Browse files Browse the repository at this point in the history
System instructions have been added to a few unstable integration tests
to enhance their stability.
  • Loading branch information
SergeyMenshykh committed Apr 23, 2024
1 parent 3cb2797 commit 91abbd7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public async Task ConnectorAgnosticFunctionCallingModelClassesCanPassFunctionExc
var kernel = this.InitializeKernel(importHelperPlugin: true);

var chatHistory = new ChatHistory();
chatHistory.AddSystemMessage("If you are unable to answer the question for whatever reason, please add the 'error' keyword to the response.");
chatHistory.AddUserMessage("Given the current time of day and weather, what is the likely color of the sky in Boston?");

var settings = new OpenAIPromptExecutionSettings() { ToolCallBehavior = ToolCallBehavior.EnableKernelFunctions };
Expand Down Expand Up @@ -300,8 +301,7 @@ public async Task ConnectorAgnosticFunctionCallingModelClassesCanPassFunctionExc
// Assert
Assert.NotNull(messageContent.Content);

var failureWords = new List<string>() { "error", "unable", "couldn", "issue", "trouble", "difficulties" };
Assert.Contains(failureWords, word => messageContent.Content.Contains(word, StringComparison.InvariantCultureIgnoreCase));
Assert.Contains("error", messageContent.Content, StringComparison.InvariantCultureIgnoreCase);
}

[Fact]
Expand All @@ -311,6 +311,7 @@ public async Task ConnectorAgnosticFunctionCallingModelClassesSupportSimulatedFu
var kernel = this.InitializeKernel(importHelperPlugin: true);

var chatHistory = new ChatHistory();
chatHistory.AddSystemMessage("if there's a tornado warning, please add the 'tornado' keyword to the response.");
chatHistory.AddUserMessage("Given the current time of day and weather, what is the likely color of the sky in Boston?");

var settings = new OpenAIPromptExecutionSettings() { ToolCallBehavior = ToolCallBehavior.EnableKernelFunctions };
Expand Down

0 comments on commit 91abbd7

Please sign in to comment.