-
Notifications
You must be signed in to change notification settings - Fork 249
How to have multiple agents? #412
-
Hi, I tried to find the answer but without success. I hope someone can answer me (;
In examples and documentation this is simple way to add agent into application - builder.AddAgent<...>() and then endpoint with app.MapPost("/api/messages", async (HttpRequest request, HttpResponse response, IAgentHttpAdapter adapter, IAgent agentApp, IServiceProvider sp, CancellationToken cancellationToken)
I would like to expose multiple endpoints for multiple Azure Bots, and when my agent answers, I want to know which Azure Bot asking by endpoint. My idea to have multiple AI models behind with own instructions in one hosted application.
Is it possible to have multiple endpoints like /api/agent1/messages and /api/agent2/messages and then answer to messages based on which endpoint used for sending messages?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
Will it understand by injected type of agent like in this example?
https://github.com/microsoft/Agents-for-net/blob/main/src/samples/MultiAgent/Program.cs
Beta Was this translation helpful? Give feedback.
All reactions
-
That sample is demonstrates how to do this using a different endpoint for each Azure Bot and injected AgentApplication types. Note that TokenValidation section in appsettings, and include the AppId of each Azure Bot in the Audiences array, and the ConnectionsMap to map an Audience to a Connection.
Beta Was this translation helpful? Give feedback.