mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Fix FunctionInvocationDelegatingAgent to preserve all AgentRunOptions properties (#4179)
When converting base AgentRunOptions to ChatClientAgentRunOptions, the middleware now preserves AllowBackgroundResponses, ContinuationToken, and AdditionalProperties in addition to ResponseFormat. Added unit test verifying all properties are preserved during the conversion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
parent
ba454552c5
commit
892c177e93
@@ -32,7 +32,13 @@ internal sealed class FunctionInvocationDelegatingAgent : DelegatingAIAgent
|
||||
{
|
||||
if (options is null || options.GetType() == typeof(AgentRunOptions))
|
||||
{
|
||||
options = new ChatClientAgentRunOptions();
|
||||
options = new ChatClientAgentRunOptions()
|
||||
{
|
||||
ResponseFormat = options?.ResponseFormat,
|
||||
AllowBackgroundResponses = options?.AllowBackgroundResponses,
|
||||
ContinuationToken = options?.ContinuationToken,
|
||||
AdditionalProperties = options?.AdditionalProperties,
|
||||
};
|
||||
}
|
||||
|
||||
if (options is not ChatClientAgentRunOptions aco)
|
||||
|
||||
Reference in New Issue
Block a user