.NET: Add AsIChatClientWithStoredOutputDisabled for ProjectResponsesClient#4911
Merged
rogerbarreto merged 2 commits intomicrosoft:mainfrom Mar 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a ProjectResponsesClient-specific AsIChatClientWithStoredOutputDisabled extension so Azure AI consumers can disable server-side response storage without taking a dependency on Microsoft.Agents.AI.OpenAI, plus adds unit tests and adjusts related XML docs.
Changes:
- Added
ProjectResponsesClientExtensions.AsIChatClientWithStoredOutputDisabled(...)inAzure.AI.Extensions.OpenAI. - Added unit tests validating null-guarding, service chain access, and
CreateResponseOptionssettings. - Updated XML doc text for the existing
OpenAIResponseClientExtensionsmethod parameter description.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/ProjectResponsesClientExtensionsTests.cs | Adds unit tests for the new extension behavior and configuration. |
| dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIResponseClientExtensions.cs | Tweaks XML docs to remove potentially outdated “required model” wording. |
| dotnet/src/Microsoft.Agents.AI.AzureAI/ProjectResponsesClientExtensions.cs | Introduces the new extension method for ProjectResponsesClient to disable stored output and optionally include reasoning encrypted content. |
dotnet/src/Microsoft.Agents.AI.AzureAI/ProjectResponsesClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/ProjectResponsesClientExtensionsTests.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.AzureAI/ProjectResponsesClientExtensions.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.AzureAI/ProjectResponsesClientExtensions.cs
Show resolved
Hide resolved
Add extension method on ProjectResponsesClient in Microsoft.Agents.AI.AzureAI package (Azure.AI.Extensions.OpenAI namespace) mirroring the existing extension on ResponsesClient in the OpenAI package. This enables Azure AI consumers to disable server-side response storage without depending on the OpenAI package. - New ProjectResponsesClientExtensions class with AsIChatClientWithStoredOutputDisabled - Optional deploymentName parameter (model is no longer required) - Updated OpenAI counterpart doc to remove 'Required' wording for model param - Added unit tests covering null guard, inner client accessibility, StoredOutputEnabled=false, and reasoning encrypted content inclusion/exclusion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address PR review feedback: wrap/chain the existing factory instead of replacing it, so upstream configuration (e.g., deploymentName/model defaults from AsIChatClient) is preserved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
542fd46 to
25334b1
Compare
lokitoth
approved these changes
Mar 25, 2026
SergeyMenshykh
approved these changes
Mar 26, 2026
westey-m
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Azure AI consumers using
ProjectResponsesClient(fromAzure.AI.Extensions.OpenAI) had no direct way to disable server-side response storage without taking a dependency on theMicrosoft.Agents.AI.OpenAIpackage. The existingAsIChatClientWithStoredOutputDisabled()extension only targeted the baseResponsesClienttype in the OpenAI package.This change adds a matching extension method for
ProjectResponsesClientin theMicrosoft.Agents.AI.AzureAIpackage, enabling Azure AI consumers to disable server-side storage natively.Description
New extension method:
ProjectResponsesClientExtensions.AsIChatClientWithStoredOutputDisabled()inAzure.AI.Extensions.OpenAInamespaceResponsesClientextension from the OpenAI packageStoredOutputEnabled = falseonCreateResponseOptionsRawRepresentationFactoryconfiguration (e.g., model defaults fromAsIChatClient)ReasoningEncryptedContentby default for stateless multi-turn conversationsdeploymentNameparameter (model is no longer required sinceAsIChatClient()accepts optional model)[Experimental(OPENAI001)]on class,[Experimental(MAAI001)]on methodDoc fix:
OpenAIResponseClientExtensions.AsIChatClientWithStoredOutputDisableddoc to remove "Required when using a plain ResponsesClient" for themodelparameterTests:
Microsoft.Agents.AI.AzureAI.UnitTestscovering:GetService<ResponsesClient>()StoredOutputEnabled = falsewith reasoning encrypted content (default)includeReasoningEncryptedContent: trueincludeReasoningEncryptedContent: falseexcludes reasoning contentdeploymentNameparameter_configureOptionsfield, matching the existing pattern inOpenAIResponseClientExtensionsTestsContribution Checklist