Skip to content

Conversation

@danroth27
Copy link
Member

You should be able to add and remove Dev UI without impacting your other production endpoints. This is the pattern used by Swagger UI, where you need to separate set up the OpenAPI endpoint that the Swagger UI depends on.

You should be able to add and remove Dev UI without impacting your other production endpoints.
Copilot AI review requested due to automatic review settings November 6, 2025 20:14
@github-actions github-actions bot changed the title Don't add OpenAIResponses as part of Dev UI .NET: Don't add OpenAIResponses as part of Dev UI Nov 6, 2025
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 removes OpenAI Responses API support from the DevUI configuration, simplifying the DevUI to focus solely on Conversations functionality.

  • Removes AddOpenAIResponses() service registration from DevUI setup
  • Removes MapOpenAIResponses() endpoint mapping from DevUI routing
  • Retains OpenAI Conversations API support for the DevUI

var group = endpoints.MapGroup("");
group.MapDevUI(pattern: "/devui");
group.MapEntities();
group.MapOpenAIConversations();
Copy link
Member

Choose a reason for hiding this comment

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

Presumably, we should remove builder.Services.AddOpenAIConversations(); and group.MapOpenAIConversations(); too if we follow this logic; right?

Ideally MapDevUI would validate that its needed services and mappings were in place and throw an InvalidOperationException if not. But I think that could come later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think so. And agreed on providing a good error diagnostic.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think MapEntites() though is more Dev UI specific.

@stephentoub
Copy link
Member

There are lots of DI-related APIs that add in necessary dependencies. Why is this different?

@danroth27
Copy link
Member Author

There are lots of DI-related APIs that add in necessary dependencies. Why is this different?

@stephentoub With DI it's pretty easy to make the Add methods idempotent. Unfortunately, that's harder to do with Map methods in ASP.NET Core that add endpoints.

group.MapEntities();
group.MapOpenAIConversations();
group.MapOpenAIResponses();
return group;
Copy link
Member

Choose a reason for hiding this comment

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

We should also be adding the bits we remove to dotnet\samples\GettingStarted\DevUI\DevUI_Step01_BasicUsage\Program.cs so that the sample still works

@jeffhandley
Copy link
Member

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.

5 participants