Skip to content

Commit 6d91511

Browse files
Merge branch 'main' into feature-text-search-linq
2 parents 1fcf4ee + 429dd1c commit 6d91511

124 files changed

Lines changed: 2881 additions & 1251 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/upgrades/prompts/SemanticKernelToAgentFramework.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -870,20 +870,16 @@ var agentOptions = new ChatClientAgentRunOptions(new ChatOptions
870870
{
871871
MaxOutputTokens = 8000,
872872
// Breaking glass to access provider-specific options
873-
RawRepresentationFactory = (_) => new OpenAI.Responses.ResponseCreationOptions()
873+
RawRepresentationFactory = (_) => new OpenAI.Responses.CreateResponseOptions()
874874
{
875-
ReasoningOptions = new()
876-
{
877-
ReasoningEffortLevel = OpenAI.Responses.ResponseReasoningEffortLevel.High,
878-
ReasoningSummaryVerbosity = OpenAI.Responses.ResponseReasoningSummaryVerbosity.Detailed
879-
}
875+
TruncationMode = OpenAI.Responses.ResponseTruncationMode.Auto,
880876
}
881877
});
882878
```
883879

884880
**Use this pattern when:**
885881
1. Standard `ChatOptions` properties don't cover required model settings
886-
2. Provider-specific configuration is needed (e.g., reasoning effort level)
882+
2. Provider-specific configuration is needed (e.g., truncation mode)
887883
3. Advanced SDK features need to be accessed
888884
</configuration_changes>
889885

dotnet/Directory.Packages.props

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PackageVersion Include="AWSSDK.SecurityToken" Version="4.0.5.6" />
2323
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.1.0" />
2424
<PackageVersion Include="Azure.AI.ContentSafety" Version="1.0.0" />
25-
<PackageVersion Include="Azure.AI.OpenAI" Version="2.7.0-beta.2" />
25+
<PackageVersion Include="Azure.AI.OpenAI" Version="2.8.0-beta.1" />
2626
<PackageVersion Include="Azure.AI.Projects" Version="1.1.0" />
2727
<PackageVersion Include="Azure.Identity" Version="1.17.1" />
2828
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.5.0" />
@@ -65,7 +65,7 @@
6565
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="12.2.8" />
6666
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.5.1" />
6767
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.3.2" />
68-
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.2" />
68+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.3" />
6969
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
7070
<PackageVersion Include="Microsoft.Bcl.Memory" Version="10.0.2" />
7171
<PackageVersion Include="Microsoft.Bcl.Numerics" Version="10.0.2" />
@@ -92,7 +92,7 @@
9292
<PackageVersion Include="Npgsql" Version="8.0.7" />
9393
<PackageVersion Include="OData2Linq" Version="2.2.0" />
9494
<PackageVersion Include="OllamaSharp" Version="5.4.12" />
95-
<PackageVersion Include="OpenAI" Version="2.7.0" />
95+
<PackageVersion Include="OpenAI" Version="2.8.0" />
9696
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.14.0" />
9797
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
9898
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
@@ -109,8 +109,8 @@
109109
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.2" />
110110
<PackageVersion Include="System.Memory.Data" Version="10.0.2" />
111111
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
112-
<PackageVersion Include="System.Numerics.Tensors" Version="10.0.2" />
113-
<PackageVersion Include="System.Text.Json" Version="10.0.2" />
112+
<PackageVersion Include="System.Numerics.Tensors" Version="10.0.3" />
113+
<PackageVersion Include="System.Text.Json" Version="10.0.3" />
114114
<PackageVersion Include="System.ValueTuple" Version="4.6.1" />
115115
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
116116
<PackageVersion Include="A2A" Version="0.3.1-preview" />
@@ -119,10 +119,10 @@
119119
<!-- Tokenizers -->
120120
<PackageVersion Include="Microsoft.ML.Tokenizers" Version="2.0.0" />
121121
<!-- Microsoft.Extensions.* -->
122-
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.2.0" />
123-
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.2.0" />
122+
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.3.0" />
123+
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.3.0" />
124124
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="10.0.0-preview.1.25559.3" />
125-
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.0.1-preview.1.25571.5" />
125+
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.3.0" />
126126
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.2" />
127127
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.2" />
128128
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.2" />
@@ -131,14 +131,14 @@
131131
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.2" />
132132
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.2" />
133133
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
134-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.2" />
134+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
135135
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Testing" Version="10.0.2" />
136136
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.2" />
137137
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.2" />
138138
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.2.0" />
139139
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.2.0" />
140140
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.2" />
141-
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.2" />
141+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.3" />
142142
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.2" />
143143
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="10.0.2" />
144144
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="10.0.2" />
@@ -151,7 +151,7 @@
151151
<PackageVersion Include="Moq" Version="[4.18.4]" />
152152
<PackageVersion Include="FluentAssertions" Version="8.2.0" />
153153
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
154-
<PackageVersion Include="System.Threading.Channels" Version="10.0.2" />
154+
<PackageVersion Include="System.Threading.Channels" Version="10.0.3" />
155155
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="10.0.2" />
156156
<PackageVersion Include="xunit" Version="2.9.3" />
157157
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />

dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step01_Basics/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async Task SKAgentAsync()
2424
Console.WriteLine("\n=== SK Agent ===\n");
2525

2626
var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
27-
.GetOpenAIResponseClient(deploymentName);
27+
.GetResponsesClient(deploymentName);
2828
OpenAIResponseAgent agent = new(responseClient)
2929
{
3030
Name = "Joker",
@@ -54,7 +54,7 @@ async Task SKAgent_As_AFAgentAsync()
5454
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");
5555

5656
var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
57-
.GetOpenAIResponseClient(deploymentName);
57+
.GetResponsesClient(deploymentName);
5858

5959
OpenAIResponseAgent skAgent = new(responseClient)
6060
{
@@ -83,7 +83,7 @@ async Task AFAgentAsync()
8383
Console.WriteLine("\n=== AF Agent ===\n");
8484

8585
var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
86-
.GetOpenAIResponseClient(deploymentName)
86+
.GetResponsesClient(deploymentName)
8787
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes.");
8888

8989
var thread = agent.GetNewThread();

dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step02_ReasoningModel/Program.cs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async Task SKAgentAsync()
5151
Console.WriteLine("\n=== SK Agent ===\n");
5252

5353
var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
54-
.GetOpenAIResponseClient(deploymentName);
54+
.GetResponsesClient(deploymentName);
5555
OpenAIResponseAgent agent = new(responseClient)
5656
{
5757
Name = "Thinker",
@@ -119,7 +119,7 @@ async Task SKAgent_As_AFAgentAsync()
119119
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");
120120

121121
var responseClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
122-
.GetOpenAIResponseClient(deploymentName);
122+
.GetResponsesClient(deploymentName);
123123

124124
#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.
125125

@@ -138,15 +138,10 @@ async Task SKAgent_As_AFAgentAsync()
138138
var agentOptions = new ChatClientAgentRunOptions(new()
139139
{
140140
MaxOutputTokens = 8000,
141-
// Microsoft.Extensions.AI currently does not have an abstraction for reasoning-effort,
142-
// we need to break glass using the RawRepresentationFactory.
143-
RawRepresentationFactory = (_) => new OpenAI.Responses.ResponseCreationOptions()
141+
Reasoning = new()
144142
{
145-
ReasoningOptions = new()
146-
{
147-
ReasoningEffortLevel = OpenAI.Responses.ResponseReasoningEffortLevel.High,
148-
ReasoningSummaryVerbosity = OpenAI.Responses.ResponseReasoningSummaryVerbosity.Detailed
149-
}
143+
Effort = ReasoningEffort.High,
144+
Output = ReasoningOutput.Full
150145
}
151146
});
152147

@@ -185,22 +180,17 @@ async Task AFAgentAsync()
185180
Console.WriteLine("\n=== AF Agent ===\n");
186181

187182
var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
188-
.GetOpenAIResponseClient(deploymentName)
183+
.GetResponsesClient(deploymentName)
189184
.CreateAIAgent(name: "Thinker", instructions: "You are good at thinking hard before answering.");
190185

191186
var thread = agent.GetNewThread();
192187
var agentOptions = new ChatClientAgentRunOptions(new()
193188
{
194189
MaxOutputTokens = 8000,
195-
// Microsoft.Extensions.AI currently does not have an abstraction for reasoning-effort,
196-
// we need to break glass using the RawRepresentationFactory.
197-
RawRepresentationFactory = (_) => new OpenAI.Responses.ResponseCreationOptions()
190+
Reasoning = new()
198191
{
199-
ReasoningOptions = new()
200-
{
201-
ReasoningEffortLevel = OpenAI.Responses.ResponseReasoningEffortLevel.High,
202-
ReasoningSummaryVerbosity = OpenAI.Responses.ResponseReasoningSummaryVerbosity.Detailed
203-
}
192+
Effort = ReasoningEffort.High,
193+
Output = ReasoningOutput.Full
204194
}
205195
});
206196

dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step03_ToolCall/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static string GetWeather([Description("The location to get the weather for.")] s
2929
async Task SKAgentAsync()
3030
{
3131
OpenAIResponseAgent agent = new(new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
32-
.GetOpenAIResponseClient(deploymentName))
32+
.GetResponsesClient(deploymentName))
3333
{ StoreEnabled = true };
3434

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

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

7272
Console.WriteLine("\n=== AF Agent Response ===\n");

dotnet/samples/AgentFrameworkMigration/AzureOpenAIResponses/Step04_DependencyInjection/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async Task SKAgentAsync()
2828
var serviceCollection = new ServiceCollection();
2929
serviceCollection.AddTransient<Microsoft.SemanticKernel.Agents.Agent>((sp)
3030
=> new OpenAIResponseAgent(new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
31-
.GetOpenAIResponseClient(deploymentName))
31+
.GetResponsesClient(deploymentName))
3232
{
3333
Name = "Joker",
3434
Instructions = "You are good at telling jokes.",
@@ -49,7 +49,7 @@ async Task SKAgent_As_AFAgentAsync()
4949
var serviceCollection = new ServiceCollection();
5050
serviceCollection.AddTransient<Microsoft.SemanticKernel.Agents.Agent>((sp)
5151
=> new OpenAIResponseAgent(new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
52-
.GetOpenAIResponseClient(deploymentName))
52+
.GetResponsesClient(deploymentName))
5353
{
5454
Name = "Joker",
5555
Instructions = "You are good at telling jokes.",
@@ -71,7 +71,7 @@ async Task AFAgentAsync()
7171

7272
var serviceCollection = new ServiceCollection();
7373
serviceCollection.AddTransient<AIAgent>((sp) => new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
74-
.GetOpenAIResponseClient(deploymentName)
74+
.GetResponsesClient(deploymentName)
7575
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes."));
7676

7777
await using ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();

dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step01_Basics/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async Task SKAgentAsync()
2121
{
2222
Console.WriteLine("\n=== SK Agent ===\n");
2323

24-
var responseClient = new OpenAIClient(apiKey).GetOpenAIResponseClient(model);
24+
var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
2525
OpenAIResponseAgent agent = new(responseClient)
2626
{
2727
Name = "Joker",
@@ -51,7 +51,7 @@ async Task SKAgent_As_AFAgentAsync()
5151
{
5252
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");
5353

54-
var responseClient = new OpenAIClient(apiKey).GetOpenAIResponseClient(model);
54+
var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
5555

5656
OpenAIResponseAgent skAgent = new(responseClient)
5757
{
@@ -79,7 +79,7 @@ async Task AFAgentAsync()
7979
{
8080
Console.WriteLine("\n=== AF Agent ===\n");
8181

82-
var agent = new OpenAIClient(apiKey).GetOpenAIResponseClient(model)
82+
var agent = new OpenAIClient(apiKey).GetResponsesClient(model)
8383
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes.");
8484

8585
var thread = agent.GetNewThread();

dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step02_ReasoningModel/Program.cs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async Task SKAgentAsync()
4848
{
4949
Console.WriteLine("\n=== SK Agent ===\n");
5050

51-
var responseClient = new OpenAIClient(apiKey).GetOpenAIResponseClient(model);
51+
var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
5252
OpenAIResponseAgent agent = new(responseClient)
5353
{
5454
Name = "Thinker",
@@ -116,7 +116,7 @@ async Task SKAgent_As_AFAgentAsync()
116116
{
117117
Console.WriteLine("\n=== SK Agent Converted as an AF Agent ===\n");
118118

119-
var responseClient = new OpenAIClient(apiKey).GetOpenAIResponseClient(model);
119+
var responseClient = new OpenAIClient(apiKey).GetResponsesClient(model);
120120

121121
#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.
122122

@@ -135,15 +135,10 @@ async Task SKAgent_As_AFAgentAsync()
135135
var agentOptions = new ChatClientAgentRunOptions(new()
136136
{
137137
MaxOutputTokens = 8000,
138-
// Microsoft.Extensions.AI currently does not have an abstraction for reasoning-effort,
139-
// we need to break glass using the RawRepresentationFactory.
140-
RawRepresentationFactory = (_) => new OpenAI.Responses.ResponseCreationOptions()
138+
Reasoning = new()
141139
{
142-
ReasoningOptions = new()
143-
{
144-
ReasoningEffortLevel = OpenAI.Responses.ResponseReasoningEffortLevel.High,
145-
ReasoningSummaryVerbosity = OpenAI.Responses.ResponseReasoningSummaryVerbosity.Detailed
146-
}
140+
Effort = ReasoningEffort.High,
141+
Output = ReasoningOutput.Full
147142
}
148143
});
149144

@@ -181,22 +176,17 @@ async Task AFAgentAsync()
181176
{
182177
Console.WriteLine("\n=== AF Agent ===\n");
183178

184-
var agent = new OpenAIClient(apiKey).GetOpenAIResponseClient(model)
179+
var agent = new OpenAIClient(apiKey).GetResponsesClient(model)
185180
.CreateAIAgent(name: "Thinker", instructions: "You are at thinking hard before answering.");
186181

187182
var thread = agent.GetNewThread();
188183
var agentOptions = new ChatClientAgentRunOptions(new()
189184
{
190185
MaxOutputTokens = 8000,
191-
// Microsoft.Extensions.AI currently does not have an abstraction for reasoning-effort,
192-
// we need to break glass using the RawRepresentationFactory.
193-
RawRepresentationFactory = (_) => new OpenAI.Responses.ResponseCreationOptions()
186+
Reasoning = new()
194187
{
195-
ReasoningOptions = new()
196-
{
197-
ReasoningEffortLevel = OpenAI.Responses.ResponseReasoningEffortLevel.High,
198-
ReasoningSummaryVerbosity = OpenAI.Responses.ResponseReasoningSummaryVerbosity.Detailed
199-
}
188+
Effort = ReasoningEffort.High,
189+
Output = ReasoningOutput.Full
200190
}
201191
});
202192

dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step03_ToolCall/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async Task SKAgentAsync()
2828
{
2929
var builder = Kernel.CreateBuilder().AddOpenAIChatClient(model, apiKey);
3030

31-
OpenAIResponseAgent agent = new(new OpenAIClient(apiKey).GetOpenAIResponseClient(model)) { StoreEnabled = true };
31+
OpenAIResponseAgent agent = new(new OpenAIClient(apiKey).GetResponsesClient(model)) { StoreEnabled = true };
3232

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

51-
OpenAIResponseAgent skAgent = new(new OpenAIClient(apiKey).GetOpenAIResponseClient(model)) { StoreEnabled = true };
51+
OpenAIResponseAgent skAgent = new(new OpenAIClient(apiKey).GetResponsesClient(model)) { StoreEnabled = true };
5252

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

6464
async Task AFAgentAsync()
6565
{
66-
var agent = new OpenAIClient(apiKey).GetOpenAIResponseClient(model).CreateAIAgent(
66+
var agent = new OpenAIClient(apiKey).GetResponsesClient(model).CreateAIAgent(
6767
instructions: "You are a helpful assistant",
6868
tools: [AIFunctionFactory.Create(GetWeather)]);
6969

dotnet/samples/AgentFrameworkMigration/OpenAIResponses/Step04_DependencyInjection/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async Task SKAgentAsync()
2525

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

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

6666
var serviceCollection = new ServiceCollection();
6767
serviceCollection.AddTransient((sp) => new OpenAIClient(apiKey)
68-
.GetOpenAIResponseClient(model)
68+
.GetResponsesClient(model)
6969
.CreateAIAgent(name: "Joker", instructions: "You are good at telling jokes."));
7070

7171
await using ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();

0 commit comments

Comments
 (0)