Skip to content

.Net Agents - CodeQL Fix #11944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public async Task AzureAIAgentWithTemplate()
Microsoft.SemanticKernel.Agents.AgentThread? agentThread = null;
try
{
await foreach (var response in agent!.InvokeAsync([], agentThread, options))
await foreach (var response in agent!.InvokeAsync(Array.Empty<ChatMessageContent>(), agentThread, options))
{
agentThread = response.Thread;
this.WriteAgentChatMessage(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.Bedrock;
using Microsoft.SemanticKernel.ChatCompletion;

namespace GettingStarted.BedrockAgents;

Expand Down Expand Up @@ -198,7 +197,7 @@ private async Task InvokeAgentAsync(Agent agent, string input, bool deleteAgent
AgentThread? agentThread = null;
try
{
await foreach (AgentResponseItem<ChatMessageContent> response in agent.InvokeAsync(new ChatMessageContent(AuthorRole.User, input)))
await foreach (AgentResponseItem<ChatMessageContent> response in agent.InvokeAsync(input))
{
agentThread = response.Thread;
WriteAgentChatMessage(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public async Task OpenAIAssistantAgentWithTemplate()
AgentThread? agentThread = null;
try
{
await foreach (var response in agent.InvokeAsync([], agentThread, options))
await foreach (var response in agent.InvokeAsync(Array.Empty<ChatMessageContent>(), agentThread, options))
{
agentThread = response.Thread;
this.WriteAgentChatMessage(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public async Task ChatCompletionAgentWithTemplate()
}
};

await foreach (ChatMessageContent response in agent.InvokeAsync([], options: options))
await foreach (ChatMessageContent response in agent.InvokeAsync(Array.Empty<ChatMessageContent>(), options: options))
{
this.WriteAgentChatMessage(response);
}
Expand Down
Loading