Internalize OpenAIResponsesModelFactory and remove it from the exported API#1142
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/81e32a2d-e940-4541-b590-a58afc1215f2 Co-authored-by: joseharriaga <[email protected]>
Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/81e32a2d-e940-4541-b590-a58afc1215f2 Co-authored-by: joseharriaga <[email protected]>
Copilot created this pull request from a session on behalf of
joseharriaga
April 30, 2026 21:53
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes OpenAIResponsesModelFactory from the public OpenAI.Responses contract by internalizing the generated factory type and updating the checked-in API baselines to match the intended supported surface.
Changes:
- Removes
OpenAIResponsesModelFactoryfrom the public API baseline files fornet10.0,net8.0, andnetstandard2.0. - Adds a TypeSpec generator customization stub (
[CodeGenType("OpenAIResponsesModelFactory")]) to ensure the factory remainsinternalacross regenerations. - Updates the generated
OpenAIResponsesModelFactorypartial type tointernalto align with the desired contract.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| api/OpenAI.Responses.netstandard2.0.cs | Removes OpenAIResponsesModelFactory from the exported public API baseline for netstandard2.0. |
| api/OpenAI.Responses.net8.0.cs | Removes OpenAIResponsesModelFactory from the exported public API baseline for net8.0. |
| api/OpenAI.Responses.net10.0.cs | Removes OpenAIResponsesModelFactory from the exported public API baseline for net10.0. |
| OpenAI.Responses/src/Generated/OpenAIResponsesModelFactory.cs | Changes the generated factory type visibility from public to internal. |
| OpenAI.Responses/src/Custom/OpenAIResponsesModelFactory.cs | Adds a generator customization partial to enforce internal visibility on regeneration. |
ShivangiReja
approved these changes
Apr 30, 2026
christothes
approved these changes
Apr 30, 2026
joseharriaga
approved these changes
May 1, 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.
OpenAIResponsesModelFactorywas still surfacing in theOpenAI.Responsespublic contract. This change aligns the Responses assembly with the intended API shape by making the factory internal and removing it from the exported API baselines.API surface
OpenAIResponsesModelFactoryfrom the public API fornet10.0,net8.0, andnetstandard2.0.Code generation customization
CodeGenTypedeclaration underOpenAI.Responses/src/Custom:Generated output alignment
OpenAIResponsesModelFactorypartial type tointernal.api/OpenAI.Responses.*.csfiles so the checked-in API baselines reflect the new contract.