Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
name committed May 19, 2023
1 parent cca83e2 commit 9e9a6a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.AI;
using Microsoft.SemanticKernel.Orchestration;
using Microsoft.SemanticKernel.Reliability;
using Microsoft.SemanticKernel.SkillDefinition;
using SemanticKernel.IntegrationTests.TestSettings;
using Xunit;
Expand Down Expand Up @@ -86,8 +88,10 @@ public async Task OpenAIChatAsTextTestAsync(string prompt, string expectedAnswer
public async Task CanUseOpenAiChatForTextCompletionAsync()
{
// Note: we use OpenAi Chat Completion and GPT 3.5 Turbo
IKernel target = Kernel.Builder.WithLogger(this._logger).Build();
this.ConfigureChatOpenAI(target);
KernelBuilder builder = Kernel.Builder.WithLogger(this._logger);
this.ConfigureChatOpenAI(builder);

IKernel target = builder.Build();

var func = target.CreateSemanticFunction(
"List the two planets after '{{$input}}', excluding moons, using bullet points.");
Expand Down Expand Up @@ -169,17 +173,21 @@ public async Task AzureOpenAIHttpRetryPolicyTestAsync(string prompt, string expe
// Arrange
var retryConfig = new HttpRetryConfig();
retryConfig.RetryableStatusCodes.Add(HttpStatusCode.Unauthorized);
IKernel target = Kernel.Builder.WithLogger(this._testOutputHelper).Configure(c => c.SetDefaultHttpRetryConfig(retryConfig)).Build();
KernelBuilder builder = Kernel.Builder
.WithLogger(this._testOutputHelper)
.Configure(c => c.SetDefaultHttpRetryConfig(retryConfig));

var azureOpenAIConfiguration = this._configuration.GetSection("AzureOpenAI").Get<AzureOpenAIConfiguration>();
Assert.NotNull(azureOpenAIConfiguration);

// Use an invalid API key to force a 401 Unauthorized response
target.Config.AddAzureTextCompletionService(
builder.WithAzureTextCompletionService(
deploymentName: azureOpenAIConfiguration.DeploymentName,
endpoint: azureOpenAIConfiguration.Endpoint,
apiKey: "INVALID_KEY");

IKernel target = builder.Build();

IDictionary<string, ISKFunction> skill = TestHelpers.GetSkills(target, "SummarizeSkill");

// Act
Expand Down
1 change: 1 addition & 0 deletions dotnet/src/SemanticKernel/Planning/Plan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public Plan(string goal)
public Plan(string goal, params ISKFunction[] steps) : this(goal)
{
this.AddSteps(steps);

}

/// <summary>
Expand Down

0 comments on commit 9e9a6a1

Please sign in to comment.