Skip to content

.NET: Simplify store=false scenario for responses#4124

Merged
westey-m merged 3 commits intomicrosoft:mainfrom
westey-m:stored-false-simplify
Feb 23, 2026
Merged

.NET: Simplify store=false scenario for responses#4124
westey-m merged 3 commits intomicrosoft:mainfrom
westey-m:stored-false-simplify

Conversation

@westey-m
Copy link
Contributor

Motivation and Context

#1118

Description

  • Simplify creation of agents using store=false with responses

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings February 20, 2026 11:46
@github-actions github-actions bot changed the title Simplify store=false scenario for responses .NET: Simplify store=false scenario for responses Feb 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the creation of agents using store=false with the OpenAI Responses API, addressing issue #1118. Previously, developers had to use the "break glass" approach via RawRepresentationFactory on ChatOptions, which was verbose and non-intuitive. The new AsIChatClientWithStoredOutputDisabled() extension method provides a clean, fluent API that encapsulates this complexity.

Changes:

  • Added AsIChatClientWithStoredOutputDisabled() extension method to simplify creating responses-based agents with store=false
  • Added comprehensive unit tests for the new extension method
  • Added sample code demonstrating the simplified API usage

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIResponseClientExtensions.cs Adds new extension method AsIChatClientWithStoredOutputDisabled() that wraps the complex RawRepresentationFactory configuration
dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIResponseClientExtensionsTests.cs Adds unit tests for null argument validation and service chain accessibility
dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Program.cs Demonstrates the new simplified API for creating agents with store=false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants