Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Internalize OpenAIResponsesModelFactory and remove it from the exported API#1142

Merged
joseharriaga merged 2 commits into
mainfrom
copilot/remove-openairesponsesmodelfactory
May 1, 2026
Merged

Internalize OpenAIResponsesModelFactory and remove it from the exported API#1142
joseharriaga merged 2 commits into
mainfrom
copilot/remove-openairesponsesmodelfactory

Conversation

Copilot AI commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

OpenAIResponsesModelFactory was still surfacing in the OpenAI.Responses public 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

    • Removes OpenAIResponsesModelFactory from the public API for net10.0, net8.0, and netstandard2.0.
    • Keeps the type available for internal/generated use without exposing it as supported public surface.
  • Code generation customization

    • Adds a custom CodeGenType declaration under OpenAI.Responses/src/Custom:
      [CodeGenType("OpenAIResponsesModelFactory")]
      internal static partial class OpenAIResponsesModelFactory
      {
      }
    • This mirrors the existing pattern used elsewhere in the repo to override generated visibility.
  • Generated output alignment

    • Updates the generated OpenAIResponsesModelFactory partial type to internal.
    • Regenerates the api/OpenAI.Responses.*.cs files so the checked-in API baselines reflect the new contract.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 OpenAIResponsesModelFactory from the public API baseline files for net10.0, net8.0, and netstandard2.0.
  • Adds a TypeSpec generator customization stub ([CodeGenType("OpenAIResponsesModelFactory")]) to ensure the factory remains internal across regenerations.
  • Updates the generated OpenAIResponsesModelFactory partial type to internal to 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.

@joseharriaga joseharriaga merged commit 670d26f into main May 1, 2026
8 checks passed
@joseharriaga joseharriaga deleted the copilot/remove-openairesponsesmodelfactory branch May 1, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants