-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
|
||
namespace Microsoft.AutoGen.Agents.Client; | ||
|
||
public static class App | ||
{ | ||
public static async Task<WebApplication> StartAsync<T>(string name) where T : AgentBase | ||
{ | ||
var clientBuilder = WebApplication.CreateBuilder(); | ||
clientBuilder.AddLocalAgentWorker().AddAgent<T>(name); | ||
var clientApp = clientBuilder.Build(); | ||
await clientApp.StartAsync().ConfigureAwait(false); | ||
return clientApp; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
|
||
namespace Microsoft.AutoGen.Agents.Runtime; | ||
|
||
public static class Host | ||
{ | ||
public static async Task<WebApplication> StartAsync(bool local = false) | ||
{ | ||
var builder = WebApplication.CreateBuilder(); | ||
if (local) | ||
{ | ||
builder.AddLocalAgentService(); | ||
} | ||
else | ||
{ | ||
builder.AddAgentService(); | ||
} | ||
var app = builder.Build(); | ||
app.MapAgentService(); | ||
await app.StartAsync().ConfigureAwait(false); | ||
return app; | ||
} | ||
} |