Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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 @@ -29,7 +29,20 @@ public async override IAsyncEnumerable<AgentRunResponseUpdate> RunStreamingAsync
};

var openAiClient = new ChatClient(model: "myModel!", credential: new ApiKeyCredential("dummy-key"), options: options).AsIChatClient();
await foreach (var update in openAiClient.GetStreamingResponseAsync(messages, cancellationToken: cancellationToken))

var chatOptions = new ChatOptions()
{
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the C# Sample Code Guidelines, prefer defining variables using explicit types rather than var to help users understand the types involved. Change var chatOptions to ChatOptions chatOptions.

Copilot generated this review using guidance from repository custom instructions.
ConversationId = threadId,
RawRepresentationFactory = _ => new ChatCompletionOptions()
{
Metadata =
{
{ "entity_id", agentName }
}
},
};

await foreach (var update in openAiClient.GetStreamingResponseAsync(messages, options: chatOptions, cancellationToken: cancellationToken))
{
yield return new AgentRunResponseUpdate(update);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ public async override IAsyncEnumerable<AgentRunResponseUpdate> RunStreamingAsync
var openAiClient = new OpenAIResponseClient(model: agentName, credential: new ApiKeyCredential("dummy-key"), options: options).AsIChatClient();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also has a problem, because you will have to pass a LLM model in the model name and not the agent name.

This is quite strange that you will have to pass the model and the agent whereas the agent also defines which model to use.

var chatOptions = new ChatOptions()
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the C# Sample Code Guidelines, prefer defining variables using explicit types rather than var to help users understand the types involved. Change var chatOptions to ChatOptions chatOptions.

Copilot generated this review using guidance from repository custom instructions.
{
ConversationId = threadId
ConversationId = threadId,
RawRepresentationFactory = _ => new ResponseCreationOptions()
{
Metadata =
{
{ "entity_id", agentName }
}
},
};

await foreach (var update in openAiClient.GetStreamingResponseAsync(messages, chatOptions, cancellationToken: cancellationToken))
Expand Down