Skip to content

Commit e08ef1e

Browse files
Merge and resolve conflicts
2 parents c11d486 + 2e831ab commit e08ef1e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dotnet/samples/GettingStartedWithAgents/AzureAIAgent/Step08_AzureAIAgent_Declarative.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public async Task AzureAIAgentWithConfigurationAsync()
3131
description: Store Telling Agent
3232
instructions: Tell a story suitable for children about the topic provided by the user.
3333
model:
34-
id: gpt-4o-mini
3534
configuration:
3635
connection_string: {TestConfiguration.AzureAI.ConnectionString}
3736
""";
@@ -182,9 +181,9 @@ private async Task InvokeAgentAsync(AzureAIAgent agent, string input)
182181
// Create a thread for the agent conversation.
183182
AgentThread thread = await agent.Client.CreateThreadAsync(metadata: SampleMetadata);
184183

185-
// Respond to user input
186184
try
187185
{
186+
// Invoke agent and display the response.
188187
await InvokeAsync(input);
189188
}
190189
finally

dotnet/src/Agents/AzureAI/Extensions/KernelExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static AIProjectClient GetAIProjectClient(this Kernel kernel, AgentDefini
3333
{
3434
var httpClient = kernel.GetAllServices<HttpClient>().FirstOrDefault();
3535
AIProjectClientOptions clientOptions = AzureAIClientProvider.CreateAzureClientOptions(httpClient);
36-
return new(connectionString!.ToString()!, new AzureCliCredential(), clientOptions);
36+
return new(connectionString!.ToString()!, new DefaultAzureCredential(), clientOptions);
3737
}
3838
}
3939

dotnet/src/Agents/OpenAI/Extensions/KernelExtensions.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ public static OpenAIClient GetOpenAIClient(this Kernel kernel, AgentDefinition a
3838
throw new InvalidOperationException("OpenAI client type must be specified.");
3939
}
4040

41-
#pragma warning disable CA2000 // Dispose objects before losing scope, not applicable because the HttpClient is created elsewhere
41+
#pragma warning disable CA2000 // Dispose objects before losing scope, not applicable because the HttpClient is created and may be used elsewhere
4242
var httpClient = HttpClientProvider.GetHttpClient(kernel.Services);
4343
#pragma warning restore CA2000 // Dispose objects before losing scope
44+
4445
if (configuration.Type.Equals(OpenAI, StringComparison.OrdinalIgnoreCase))
4546
{
4647
OpenAIClientOptions clientOptions = OpenAIClientProvider.CreateOpenAIClientOptions(configuration.GetEndpointUri(), httpClient);

0 commit comments

Comments
 (0)