Files
agent-framework/dotnet/samples/AgentWebChat/AgentWebChat.AppHost/Program.cs
T
Korolev Dmitry 1da9107f4a .NET: Improve AIAgent and Workflow registrations for DevUI integration (#2227)
* wip

* resolve non-agent workflows as well!

* add tests for devui registrations and resolving

* fixes

* devui for net8 as well!

* simplify TFM

* update tfm...

* tfm rules....

* wip

* roll

* verify entities are registered with a devui call

* tests

* add a proper support for non-keyed workflows

* resolve default aiagent registration

* sort usings :)

* cleanup tests
2025-11-18 15:38:00 +00:00

22 lines
916 B
C#

// Copyright (c) Microsoft. All rights reserved.
using AgentWebChat.AppHost;
var builder = DistributedApplication.CreateBuilder(args);
var azOpenAiResource = builder.AddParameterFromConfiguration("AzureOpenAIName", "AzureOpenAI:Name");
var azOpenAiResourceGroup = builder.AddParameterFromConfiguration("AzureOpenAIResourceGroup", "AzureOpenAI:ResourceGroup");
var chatModel = builder.AddAIModel("chat-model").AsAzureOpenAI("gpt-4o", o => o.AsExisting(azOpenAiResource, azOpenAiResourceGroup));
var agentHost = builder.AddProject<Projects.AgentWebChat_AgentHost>("agenthost")
.WithHttpEndpoint(name: "devui")
.WithUrlForEndpoint("devui", (url) => new() { Url = "/devui", DisplayText = "Dev UI" })
.WithReference(chatModel);
builder.AddProject<Projects.AgentWebChat_Web>("webfrontend")
.WithExternalHttpEndpoints()
.WithReference(agentHost)
.WaitFor(agentHost);
builder.Build().Run();