Skip to content

Commit dfe4208

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

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

dotnet/samples/GettingStartedWithAgents/AzureAIAgent/Step08_AzureAIAgent_Declarative.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public async Task AzureAIAgentWithOpenApiAsync()
106106
var agent = await factory.CreateAgentFromYamlAsync(text, this._kernel) as AzureAIAgent;
107107
Assert.NotNull(agent);
108108

109-
await InvokeAgentAsync(agent!, "Use code to determine the values in the Fibonacci sequence that that are less then the value of 101?");
109+
await InvokeAgentAsync(agent!, "What country has Dublin as it's capital city?");
110110
}
111111

112112
[Fact]
@@ -182,9 +182,9 @@ private async Task InvokeAgentAsync(AzureAIAgent agent, string input)
182182
// Create a thread for the agent conversation.
183183
AgentThread thread = await agent.Client.CreateThreadAsync(metadata: SampleMetadata);
184184

185-
// Respond to user input
186185
try
187186
{
187+
// Invoke agent and display the response.
188188
await InvokeAsync(input);
189189
}
190190
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

+3-2
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);
@@ -58,7 +59,7 @@ public static OpenAIClient GetOpenAIClient(this Kernel kernel, AgentDefinition a
5859
return new AzureOpenAIClient(endpoint, configuration.GetApiKeyCredential(), clientOptions);
5960
}
6061

61-
return new AzureOpenAIClient(endpoint, new AzureCliCredential(), clientOptions);
62+
return new AzureOpenAIClient(endpoint, new DefaultAzureCredential(), clientOptions);
6263
}
6364

6465
throw new InvalidOperationException($"Invalid OpenAI client type '{configuration.Type}' was specified.");

0 commit comments

Comments
 (0)