Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleLittleCloud committed Oct 15, 2024
1 parent 683f712 commit 4ae99c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// KernelFunctionMiddlewareTests.cs
// Copyright (c) Microsoft. All rights reserved.

using System.ClientModel;
using AutoGen.Core;
using AutoGen.OpenAI;
using AutoGen.OpenAI.Extension;
using AutoGen.Tests;
using Azure;
using Azure.AI.OpenAI;
using FluentAssertions;
using Microsoft.SemanticKernel;
Expand All @@ -22,7 +21,7 @@ public async Task ItRegisterKernelFunctionMiddlewareFromTestPluginTests()
var deployName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOY_NAME") ?? throw new Exception("Please set AZURE_OPENAI_DEPLOY_NAME environment variable.");
var openaiClient = new AzureOpenAIClient(
endpoint: new Uri(endpoint),
credential: new AzureKeyCredential(key));
credential: new ApiKeyCredential(key));

var kernel = new Kernel();
var plugin = kernel.ImportPluginFromType<TestPlugin>();
Expand Down Expand Up @@ -68,7 +67,7 @@ public async Task ItRegisterKernelFunctionMiddlewareFromMethodTests()
var deployName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOY_NAME") ?? throw new Exception("Please set AZURE_OPENAI_DEPLOY_NAME environment variable.");
var openaiClient = new AzureOpenAIClient(
endpoint: new Uri(endpoint),
credential: new AzureKeyCredential(key));
credential: new ApiKeyCredential(key));

var kernel = new Kernel();
var getWeatherMethod = kernel.CreateFunctionFromMethod((string location) => $"The weather in {location} is sunny.", functionName: "GetWeather", description: "Get the weather for a location.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// OpenAIChatCompletionMiddlewareTests.cs

using System.ClientModel;
using System.ClientModel.Primitives;
using AutoGen.Core;
using AutoGen.OpenAI;
Expand Down Expand Up @@ -73,7 +74,7 @@ private IHostBuilder CreateHostBuilder(IAgent agent)

private OpenAIClient CreateOpenAIClient(HttpClient client)
{
return new OpenAIClient("api-key", new OpenAIClientOptions
return new OpenAIClient(new ApiKeyCredential("api-key"), new OpenAIClientOptions
{
Transport = new HttpClientPipelineTransport(client),
});
Expand Down

0 comments on commit 4ae99c9

Please sign in to comment.