Skip to content
Open
24 changes: 12 additions & 12 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<PackageVersion Include="AWSSDK.SecurityToken" Version="4.0.5.6" />
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.1.0" />
<PackageVersion Include="Azure.AI.ContentSafety" Version="1.0.0" />
<PackageVersion Include="Azure.AI.OpenAI" Version="2.8.0-beta.1" />
<PackageVersion Include="Azure.AI.Projects" Version="1.1.0" />
<PackageVersion Include="Azure.Identity" Version="1.17.1" />
<PackageVersion Include="Azure.AI.OpenAI" Version="2.9.0-beta.1" />
<PackageVersion Include="Azure.AI.Projects" Version="2.0.0-beta.2" />
<PackageVersion Include="Azure.Identity" Version="1.19.0" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.5.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.7.0" />
<PackageVersion Include="Community.OData.Linq" Version="2.1.0" />
Expand Down Expand Up @@ -92,7 +92,7 @@
<PackageVersion Include="Npgsql" Version="8.0.7" />
<PackageVersion Include="OData2Linq" Version="2.2.0" />
<PackageVersion Include="OllamaSharp" Version="5.4.12" />
<PackageVersion Include="OpenAI" Version="2.8.0" />
<PackageVersion Include="OpenAI" Version="2.9.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
Expand All @@ -109,8 +109,8 @@
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.4" />
<PackageVersion Include="System.Memory.Data" Version="10.0.2" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Numerics.Tensors" Version="10.0.3" />
<PackageVersion Include="System.Text.Json" Version="10.0.3" />
<PackageVersion Include="System.Numerics.Tensors" Version="10.0.4" />
<PackageVersion Include="System.Text.Json" Version="10.0.4" />
<PackageVersion Include="System.ValueTuple" Version="4.6.1" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
<PackageVersion Include="A2A" Version="0.3.1-preview" />
Expand All @@ -119,10 +119,10 @@
<!-- Tokenizers -->
<PackageVersion Include="Microsoft.ML.Tokenizers" Version="2.0.0" />
<!-- Microsoft.Extensions.* -->
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.3.0" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.3.0" />
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.4.0" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.4.0" />
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="10.0.0-preview.1.25559.3" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.3.0" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.4.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.2" />
Expand All @@ -131,14 +131,14 @@
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.4" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Testing" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.2.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.2.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.4" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="10.0.2" />
Expand All @@ -151,7 +151,7 @@
<PackageVersion Include="Moq" Version="[4.18.4]" />
<PackageVersion Include="FluentAssertions" Version="8.2.0" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="System.Threading.Channels" Version="10.0.3" />
<PackageVersion Include="System.Threading.Channels" Version="10.0.4" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="10.0.2" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;
using Microsoft.SemanticKernel.Agents.OpenAI;
using OpenAI;

Expand All @@ -24,8 +25,8 @@ async Task SKAgentAsync()
Console.WriteLine("\n=== SK Agent ===\n");

var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName);
OpenAIResponseAgent agent = new(responseClient)
.GetResponsesClient();
OpenAIResponseAgent agent = new(responseClient, deploymentName)
{
Name = "Joker",
Instructions = "You are good at telling jokes.",
Expand Down Expand Up @@ -54,9 +55,9 @@ async Task SKAgent_As_AFAgentAsync()
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");

var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName);
.GetResponsesClient();

OpenAIResponseAgent skAgent = new(responseClient)
OpenAIResponseAgent skAgent = new(responseClient, deploymentName)
{
Name = "Joker",
Instructions = "You are good at telling jokes.",
Expand All @@ -83,7 +84,7 @@ async Task AFAgentAsync()
Console.WriteLine("\n=== AF Agent ===\n");

var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName)
.GetResponsesClient().AsIChatClient(deploymentName)
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes.");

var thread = agent.GetNewThread();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ async Task SKAgentAsync()
Console.WriteLine("\n=== SK Agent ===\n");

var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName);
OpenAIResponseAgent agent = new(responseClient)
.GetResponsesClient();
OpenAIResponseAgent agent = new(responseClient, deploymentName)
{
Name = "Thinker",
Instructions = "You are good at thinking hard before answering.",
Expand Down Expand Up @@ -119,11 +119,11 @@ async Task SKAgent_As_AFAgentAsync()
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");

var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName);
.GetResponsesClient();

#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

OpenAIResponseAgent skAgent = new(responseClient)
OpenAIResponseAgent skAgent = new(responseClient, deploymentName)
{
Name = "Thinker",
Instructions = "You are good at thinking hard before answering.",
Expand Down Expand Up @@ -180,7 +180,7 @@ async Task AFAgentAsync()
Console.WriteLine("\n=== AF Agent ===\n");

var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName)
.GetResponsesClient().AsIChatClient(deploymentName)
.CreateAIAgent(name: "Thinker", instructions: "You are good at thinking hard before answering.");

var thread = agent.GetNewThread();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static string GetWeather([Description("The location to get the weather for.")] s
async Task SKAgentAsync()
{
OpenAIResponseAgent agent = new(new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName))
.GetResponsesClient(), deploymentName)
{ StoreEnabled = true };

// Initialize plugin and add to the agent's Kernel (same as direct Kernel usage).
Expand All @@ -49,7 +49,7 @@ async Task SKAgentAsync()
async Task SKAgent_As_AFAgentAsync()
{
OpenAIResponseAgent skAgent = new(new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName))
.GetResponsesClient(), deploymentName)
{ StoreEnabled = true };

// Initialize plugin and add to the agent's Kernel (same as direct Kernel usage).
Expand All @@ -66,7 +66,7 @@ async Task SKAgent_As_AFAgentAsync()
async Task AFAgentAsync()
{
var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName)
.GetResponsesClient().AsIChatClient(deploymentName)
.CreateAIAgent(instructions: "You are a helpful assistant", tools: [AIFunctionFactory.Create(GetWeather)]);

Console.WriteLine("\n=== AF Agent Response ===\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async Task SKAgentAsync()
var serviceCollection = new ServiceCollection();
serviceCollection.AddTransient<Microsoft.SemanticKernel.Agents.Agent>((sp)
=> new OpenAIResponseAgent(new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName))
.GetResponsesClient(), deploymentName)
{
Name = "Joker",
Instructions = "You are good at telling jokes.",
Expand All @@ -49,7 +49,7 @@ async Task SKAgent_As_AFAgentAsync()
var serviceCollection = new ServiceCollection();
serviceCollection.AddTransient<Microsoft.SemanticKernel.Agents.Agent>((sp)
=> new OpenAIResponseAgent(new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName))
.GetResponsesClient(), deploymentName)
{
Name = "Joker",
Instructions = "You are good at telling jokes.",
Expand All @@ -71,7 +71,7 @@ async Task AFAgentAsync()

var serviceCollection = new ServiceCollection();
serviceCollection.AddTransient<AIAgent>((sp) => new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
.GetResponsesClient(deploymentName)
.GetResponsesClient().AsIChatClient(deploymentName)
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes."));

await using ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;
using Microsoft.SemanticKernel.Agents.OpenAI;
using OpenAI;

Expand All @@ -21,7 +22,7 @@ async Task SKAgentAsync()
{
Console.WriteLine("\n=== SK Agent ===\n");

var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
var responseClient = new OpenAIClient(apiKey).GetResponsesClient();
OpenAIResponseAgent agent = new(responseClient)
{
Name = "Joker",
Expand Down Expand Up @@ -51,7 +52,7 @@ async Task SKAgent_As_AFAgentAsync()
{
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");

var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
var responseClient = new OpenAIClient(apiKey).GetResponsesClient();

OpenAIResponseAgent skAgent = new(responseClient)
{
Expand Down Expand Up @@ -79,7 +80,7 @@ async Task AFAgentAsync()
{
Console.WriteLine("\n=== AF Agent ===\n");

var agent = new OpenAIClient(apiKey).GetResponsesClient(model)
var agent = new OpenAIClient(apiKey).GetResponsesClient().AsIChatClient(model)
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes.");

var thread = agent.GetNewThread();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async Task SKAgentAsync()
{
Console.WriteLine("\n=== SK Agent ===\n");

var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
var responseClient = new OpenAIClient(apiKey).GetResponsesClient();
OpenAIResponseAgent agent = new(responseClient)
{
Name = "Thinker",
Expand Down Expand Up @@ -116,7 +116,7 @@ async Task SKAgent_As_AFAgentAsync()
{
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");

var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
var responseClient = new OpenAIClient(apiKey).GetResponsesClient();

#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

Expand Down Expand Up @@ -176,7 +176,7 @@ async Task AFAgentAsync()
{
Console.WriteLine("\n=== AF Agent ===\n");

var agent = new OpenAIClient(apiKey).GetResponsesClient(model)
var agent = new OpenAIClient(apiKey).GetResponsesClient().AsIChatClient(model)
.CreateAIAgent(name: "Thinker", instructions: "You are at thinking hard before answering.");

var thread = agent.GetNewThread();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async Task SKAgentAsync()
{
var builder = Kernel.CreateBuilder().AddOpenAIChatClient(model, apiKey);

OpenAIResponseAgent agent = new(new OpenAIClient(apiKey).GetResponsesClient(model)) { StoreEnabled = true };
OpenAIResponseAgent agent = new(new OpenAIClient(apiKey).GetResponsesClient(), model) { StoreEnabled = true };

// Initialize plugin and add to the agent's Kernel (same as direct Kernel usage).
agent.Kernel.Plugins.Add(KernelPluginFactory.CreateFromFunctions("KernelPluginName", [KernelFunctionFactory.CreateFromMethod(GetWeather)]));
Expand All @@ -48,7 +48,7 @@ async Task SKAgent_As_AFAgentAsync()
{
var builder = Kernel.CreateBuilder().AddOpenAIChatClient(model, apiKey);

OpenAIResponseAgent skAgent = new(new OpenAIClient(apiKey).GetResponsesClient(model)) { StoreEnabled = true };
OpenAIResponseAgent skAgent = new(new OpenAIClient(apiKey).GetResponsesClient(), model) { StoreEnabled = true };

// Initialize plugin and add to the agent's Kernel (same as direct Kernel usage).
skAgent.Kernel.Plugins.Add(KernelPluginFactory.CreateFromFunctions("KernelPluginName", [KernelFunctionFactory.CreateFromMethod(GetWeather)]));
Expand All @@ -63,7 +63,7 @@ async Task SKAgent_As_AFAgentAsync()

async Task AFAgentAsync()
{
var agent = new OpenAIClient(apiKey).GetResponsesClient(model).CreateAIAgent(
var agent = new OpenAIClient(apiKey).GetResponsesClient().AsIChatClient(model).CreateAIAgent(
instructions: "You are a helpful assistant",
tools: [AIFunctionFactory.Create(GetWeather)]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async Task SKAgentAsync()

var serviceCollection = new ServiceCollection();
serviceCollection.AddTransient<Microsoft.SemanticKernel.Agents.Agent>((sp)
=> new OpenAIResponseAgent(new OpenAIClient(apiKey).GetResponsesClient(model))
=> new OpenAIResponseAgent(new OpenAIClient(apiKey).GetResponsesClient(), model)
{
Name = "Joker",
Instructions = "You are good at telling jokes."
Expand All @@ -44,7 +44,7 @@ async Task SKAgent_As_AFAgentAsync()

var serviceCollection = new ServiceCollection();
serviceCollection.AddTransient<Microsoft.SemanticKernel.Agents.Agent>((sp)
=> new OpenAIResponseAgent(new OpenAIClient(apiKey).GetResponsesClient(model))
=> new OpenAIResponseAgent(new OpenAIClient(apiKey).GetResponsesClient(), model)
{
Name = "Joker",
Instructions = "You are good at telling jokes."
Expand All @@ -65,7 +65,7 @@ async Task AFAgentAsync()

var serviceCollection = new ServiceCollection();
serviceCollection.AddTransient((sp) => new OpenAIClient(apiKey)
.GetResponsesClient(model)
.GetResponsesClient().AsIChatClient(model)
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes."));

await using ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();
Expand Down
Loading
Loading