diff --git a/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs b/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs index 5a280172..da074555 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs @@ -12,5 +12,12 @@ public interface IRoutingService void ResetRecursiveCounter(); Task InvokeAgent(string agentId, List dialogs); Task InstructLoop(RoleDialogModel message); + + /// + /// Talk to a specific Agent directly, bypassing the Router + /// + /// + /// + /// Task ExecuteOnce(Agent agent, RoleDialogModel message); } diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.cs index 1ce7cfb7..41845eda 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.cs @@ -36,7 +36,9 @@ public partial class RoutingService : IRoutingService var handlers = _services.GetServices(); var handler = handlers.FirstOrDefault(x => x.Name == "route_to_agent"); - var dialogs = new List { message }; + + var conv = _services.GetRequiredService(); + var dialogs = conv.GetDialogHistory(); handler.SetDialogs(dialogs); var inst = new FunctionCallFromLlm diff --git a/tests/BotSharp.Plugin.PizzaBot/PizzaBotPlugin.cs b/tests/BotSharp.Plugin.PizzaBot/PizzaBotPlugin.cs index 3ee956d8..e1a1d61a 100644 --- a/tests/BotSharp.Plugin.PizzaBot/PizzaBotPlugin.cs +++ b/tests/BotSharp.Plugin.PizzaBot/PizzaBotPlugin.cs @@ -6,6 +6,8 @@ namespace BotSharp.Plugin.PizzaBot; public class PizzaBotPlugin : IBotSharpPlugin { public string Name => "Pizza AI Assistant"; + public string Description => "An example of an enterprise-grade AI Chatbot."; + public void RegisterDI(IServiceCollection services, IConfiguration config) { // Register hooks