Skip to content

Commit 5b297fb

Browse files
committed
back off of aspnet
1 parent 7093034 commit 5b297fb

File tree

1 file changed

+5
-7
lines changed
  • dotnet/src/Microsoft.AutoGen/Core.Grpc

1 file changed

+5
-7
lines changed

dotnet/src/Microsoft.AutoGen/Core.Grpc/App.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Diagnostics;
44
using System.Diagnostics.CodeAnalysis;
55
using Google.Protobuf;
6-
using Microsoft.AspNetCore.Builder;
76
using Microsoft.Extensions.DependencyInjection;
87
using Microsoft.Extensions.DependencyInjection.Extensions;
98
using Microsoft.Extensions.Hosting;
@@ -13,25 +12,24 @@ namespace Microsoft.AutoGen.Core.Grpc;
1312
public static class AgentsApp
1413
{
1514
// need a variable to store the runtime instance
16-
public static WebApplication? Host { get; private set; }
15+
public static IHost? Host { get; private set; }
1716

1817
[MemberNotNull(nameof(Host))]
19-
public static async ValueTask<WebApplication> StartAsync(WebApplicationBuilder? builder = null, AgentTypes? agentTypes = null, bool local = false)
18+
public static async ValueTask<IHost> StartAsync(HostApplicationBuilder? builder = null, AgentTypes? agentTypes = null, bool local = false)
2019
{
21-
builder ??= WebApplication.CreateBuilder();
20+
builder ??= new HostApplicationBuilder();
2221
builder.Services.TryAddSingleton(DistributedContextPropagator.Current);
2322
builder.AddGrpcAgentWorker()
2423
.AddAgents(agentTypes);
25-
builder.AddServiceDefaults();
2624
var app = builder.Build();
2725
Host = app;
2826
await app.StartAsync().ConfigureAwait(false);
2927
return Host;
3028
}
31-
public static async ValueTask<WebApplication> PublishMessageAsync(
29+
public static async ValueTask<IHost> PublishMessageAsync(
3230
string topic,
3331
IMessage message,
34-
WebApplicationBuilder? builder = null,
32+
HostApplicationBuilder? builder = null,
3533
AgentTypes? agents = null,
3634
bool local = false)
3735
{

0 commit comments

Comments
 (0)