mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
e7441ee29e
* Add agent hosting package and update sample * Review feedback and cleanup * Include the narrator * wip * wip * Remove workaround for empty state writes. * Handle changes to AgentThread. * One more. * Fix. --------- Co-authored-by: Aditya Mandaleeka <adityam@microsoft.com>
27 lines
1.2 KiB
C#
27 lines
1.2 KiB
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 cosmosDbResource = builder.AddParameterFromConfiguration("CosmosDbName", "CosmosDb:Name");
|
|
var cosmosDbResourceGroup = builder.AddParameterFromConfiguration("CosmosDbResourceGroup", "CosmosDb:ResourceGroup");
|
|
var cosmos = builder.AddAzureCosmosDB("agent-web-chat-cosmosdb").RunAsExisting(cosmosDbResource, cosmosDbResourceGroup);
|
|
|
|
var stateDb = cosmos.AddCosmosDatabase("actor-state-db");
|
|
|
|
var agentHost = builder.AddProject<Projects.AgentWebChat_AgentHost>("agenthost")
|
|
.WithReference(chatModel)
|
|
.WithReference(cosmos).WaitFor(cosmos);
|
|
|
|
builder.AddProject<Projects.AgentWebChat_Web>("webfrontend")
|
|
.WithExternalHttpEndpoints()
|
|
.WithReference(agentHost)
|
|
.WaitFor(agentHost);
|
|
|
|
builder.Build().Run();
|