You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET: Passing ChatClientAgent specific run options #521
Today we have multiple approaches to passing ChatClientAgent specific run options:
RunAsync, which takes AgentRunOptions? options as input, can be passed a ChatClientAgentRunOptions
We have a RunAsync overload in ChatClientAgentExtensions which takes AgentRunOptions? agentRunOptions and ChatOptions? chatOptions as input.
Since ChatClientAgentRunOptions is a subclass of AgentRunOptions, it can in theory be passed to this overload. ChatClientAgentRunOptions contains a ChatOptions inside of it, so it's unclear what would happen if someone passed both ChatClientAgentRunOptions and ChatOptions.
Since the 2nd method has some ambiguity, I propose that we remove it and only keep the original RunAsync method.
Change the 2nd to instead of getting AgentRunOptions expect the specialization directly ChatClientAgentRunOptions
Some extra thoughts.
How about internalize the ChatClientAgentRunOptions completely, so we avoid adding this ambiguity in the apis and resort to something like: ChatClientAgentRunOptions agentOptions.WithChatOptions(ChatOptions)
Activity
[-]Passing ChatClientAgent specific run options[/-][+].NET: Passing ChatClientAgent specific run options[/+]rogerbarreto commentedon Aug 28, 2025
Alternatively
AgentRunOptionsexpect the specialization directlyChatClientAgentRunOptionsSome extra thoughts.
How about internalize the
ChatClientAgentRunOptionscompletely, so we avoid adding this ambiguity in the apis and resort to something like:ChatClientAgentRunOptions agentOptions.WithChatOptions(ChatOptions)