AgentFrameworkBuilderExtensions Methods
AddDevUI(IDistributedApplicationBuilder, string, int?) Section titled AddDevUI(IDistributedApplicationBuilder, string, int?) extension IResourceBuilder<DevUIResource> public static class AgentFrameworkBuilderExtensions{ public static IResourceBuilder<DevUIResource> AddDevUI( this IDistributedApplicationBuilder builder, string name, int? port = null) { // ... }}Parameters
builder IDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder. name string The name to give the resource. port int? optional The host port for the DevUI web interface. If not specified, a random port will be assigned. Returns
IResourceBuilder<DevUIResource> A reference to the ApplicationModel.IResourceBuilder`1 for chaining. Remarks
DevUI is a web-based interface for testing and debugging AI agents using the OpenAI Responses protocol. When configured with AgentFrameworkBuilderExtensions.WithAgentService, it aggregates agents from multiple backend services and provides a unified testing interface.
The aggregator runs as an in-process reverse proxy within the AppHost, requiring no external container image. It serves the DevUI frontend from embedded resources in Microsoft.Agents.AI.DevUI when available, and falls back to proxying from the first configured backend. It aggregates entity listings from all backends.
This resource is excluded from the deployment manifest as it is intended for development use only.
Examples
var devui = builder.AddDevUI("devui") .WithAgentService(dotnetAgent) .WithAgentService(pythonAgent);WithAgentService(IResourceBuilder<DevUIResource>, IResourceBuilder<TSource>, IReadOnlyList<AgentEntityInfo>, string?) Section titled WithAgentService(IResourceBuilder<DevUIResource>, IResourceBuilder<TSource>, IReadOnlyList<AgentEntityInfo>, string?) extension IResourceBuilder<DevUIResource> public static class AgentFrameworkBuilderExtensions{ public static IResourceBuilder<DevUIResource> WithAgentService<TSource>( this IResourceBuilder<DevUIResource> builder, IResourceBuilder<TSource> agentService, IReadOnlyList<AgentEntityInfo>? agents = null, string? entityIdPrefix = null) { // ... }}Parameters
builder IResourceBuilder<DevUIResource> The DevUI resource builder. agentService IResourceBuilder<TSource> The agent service resource to connect to. agents IReadOnlyList<AgentEntityInfo> optional Optional list of agents declared by this backend. When provided, the aggregator uses these declarations directly. When not provided, defaults to a single agent named after the agentService resource. The backend doesn't need to expose a /v1/entities endpoint in either case. entityIdPrefix string? optional An optional prefix to add to entity IDs from this backend. If not specified, the resource name will be used as the prefix. Returns
IResourceBuilder<DevUIResource> A reference to the ApplicationModel.IResourceBuilder`1 for chaining. Remarks
Each agent service should expose the OpenAI Responses and Conversations API endpoints (via MapOpenAIResponses and MapOpenAIConversations).
When agents is provided, the aggregator builds the entity listing from these declarations without querying the backend. When not provided, a single agent named after the service resource is assumed. Agent services don't need a /v1/entities endpoint.
Examples
var writerAgent = builder.AddProject<Projects.WriterAgent>("writer-agent");var editorAgent = builder.AddProject<Projects.EditorAgent>("editor-agent");
builder.AddDevUI("devui") .WithAgentService(writerAgent, agents: [new("writer", "Writes short stories")]) .WithAgentService(editorAgent, agents: [new("editor", "Edits and formats stories")]) .WaitFor(writerAgent) .WaitFor(editorAgent);