diff --git a/src/Infrastructure/BotSharp.Abstraction/Agents/IAgentService.cs b/src/Infrastructure/BotSharp.Abstraction/Agents/IAgentService.cs index 20599d65..4bf197ea 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Agents/IAgentService.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Agents/IAgentService.cs @@ -7,7 +7,7 @@ public interface IAgentService { Task CreateAgent(Agent agent); Task RefreshAgents(); - Task> GetAgents(); + Task> GetAgents(bool? allowRouting = null); /// /// Load agent configurations and trigger hooks diff --git a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs index d9d3cd40..6b749b3b 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs @@ -7,9 +7,9 @@ public partial class AgentService #if !DEBUG [MemoryCache(10 * 60)] #endif - public async Task> GetAgents() + public async Task> GetAgents(bool? allowRouting = null) { - var agents = _db.GetAgentsByUser(_user.Id); + var agents = _db.GetAgents(allowRouting: allowRouting); return await Task.FromResult(agents); } diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs index 515d6922..c08230ad 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs @@ -137,7 +137,7 @@ public partial class RoutingService private void FixMalformedResponse(FunctionCallFromLlm args) { var agentService = _services.GetRequiredService(); - var agents = agentService.GetAgents().Result; + var agents = agentService.GetAgents(allowRouting: true).Result; var malformed = false; // Sometimes it populate malformed Function in Agent name