Skip to content

Commit 3530a99

Browse files
committed
enable AGENT_HOST var from aspire
1 parent 3ee182d commit 3530a99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dotnet/src/Microsoft.AutoGen/Agents/Services/HostBuilderExtensions.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ namespace Microsoft.AutoGen.Agents;
1616
public static class HostBuilderExtensions
1717
{
1818
private const string _defaultAgentServiceAddress = "https://localhost:5001";
19-
public static AgentApplicationBuilder AddAgentWorker(this IHostApplicationBuilder builder, string agentServiceAddress = _defaultAgentServiceAddress, bool local = false)
19+
public static AgentApplicationBuilder AddAgentWorker(this IHostApplicationBuilder builder, string? agentServiceAddress = null, bool local = false)
2020
{
21+
agentServiceAddress ??= builder.Configuration["AGENT_HOST"] ?? _defaultAgentServiceAddress;
2122
builder.Services.TryAddSingleton(DistributedContextPropagator.Current);
2223

2324
// if !local, then add the gRPC client

0 commit comments

Comments
 (0)