Fig 3.5.1 An example of routing-based multi-agent architecture.
### Agent Setup
Here we introduce the agent setup with utilities and inheritance. As we introduced in [Section 3.3](#utility-hooks), each utility of an agent is structured with utility name, functions, and prompts. [Fig 3.6.1](#router-utility) and [Fig 3.6.2](#task-agent-utility) presents the utility configuration and utility inheritance of “Pizza Bot” and “Order Inquery”, respectively. As is displayed, we can apply the utility configuration and inheritance via agent files or agent detail ui. Note that we can uncheck the box to disable a utility ([Fig 3.6.1](#router-utility) right).
-
+
-
Fig 3.6.1 Router utility setup of "Pizza Bot".
-
(left: agent file, right: agent detail ui)
+
Fig 3.6.1 Router utility setup of "Pizza Bot".
+
(left: agent file, right: agent detail ui)
+
-
Fig 3.6.2 Utility inheritance of "Order Inquery" agent.
-
(left: agent file, right: agent detail ui)
+
Fig 3.6.2 Utility inheritance of "Order Inquery" agent.
+
(left: agent file, right: agent detail ui)
@@ -92,13 +357,29 @@ Here we introduce the agent setup with utilities and inheritance. As we introduc
## Agent Utility Integration
In this section, we outline the steps to integrate a custom agent utility, including registering plugin, registering assembly, and adding project reference.
-[Fig 4.1.1](#register-plugin) presents the “Http Handler Plugin” in the “BotSharp.Plugin.HttpHandler”, where we can register the hooks and other essential settings. Note that there is no need to register the function here, since it is automatically registered on the application level.
-
-
-

-
Fig 4.1.1 Register plugin.
-
-
+The code snippet below presents the “Http Handler Plugin” in the “BotSharp.Plugin.HttpHandler”, where we can register the hooks and other essential settings. Note that there is no need to register the function here, since it is automatically registered on the application level.
+
+```csharp
+public class HttpHandlerPlugin : IBotSharpPlugin
+{
+ public string Id => "2c1eb1c4-16e5-4c65-8ee4-032324c26b81";
+ public string Name => "HTTP Handler";
+ public string Description => "Empower agent to handle HTTP request in RESTful API or GraphQL";
+ public string IconUrl => "https://lirp.cdn-website.com/6f8d6d8a/dms3rep/multi/opt/API_Icon-640w.png";
+ public string[] AgentIds => new[] { "87c458fc-ec5f-40ae-8ed6-05dda8a07523" };
+
+ public void RegisterDI(IServiceCollection services, IConfiguration config)
+ {
+ services.AddScoped(provider =>
+ {
+ var settingService = provider.GetRequiredService
();
+ return settingService.Bind("HttpHandler");
+ });
+
+ services.AddScoped();
+ }
+}
+```
[Fig 4.1.2](#register-assembly) shows the utility assembly registration in “appsettings.json”. It is important to note that we are required to add the project reference to the Startup project, e.g., WebStarter. Moreover, we are required to add any new custom agent utility in the “Plugin” folder instead of the “BotSharp” folder.