Skip to content

Commit 7fb9440

Browse files
committed
Fix GetAgents list.
1 parent 758cfd5 commit 7fb9440

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Infrastructure/BotSharp.Abstraction/Agents/IAgentService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public interface IAgentService
77
{
88
Task<Agent> CreateAgent(Agent agent);
99
Task RefreshAgents();
10-
Task<List<Agent>> GetAgents();
10+
Task<List<Agent>> GetAgents(bool? allowRouting = null);
1111

1212
/// <summary>
1313
/// Load agent configurations and trigger hooks

src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ public partial class AgentService
77
#if !DEBUG
88
[MemoryCache(10 * 60)]
99
#endif
10-
public async Task<List<Agent>> GetAgents()
10+
public async Task<List<Agent>> GetAgents(bool? allowRouting = null)
1111
{
12-
var agents = _db.GetAgentsByUser(_user.Id);
12+
var agents = _db.GetAgents(allowRouting: allowRouting);
1313
return await Task.FromResult(agents);
1414
}
1515

src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetNextInstruction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private string GetNextStepPrompt()
137137
private void FixMalformedResponse(FunctionCallFromLlm args)
138138
{
139139
var agentService = _services.GetRequiredService<IAgentService>();
140-
var agents = agentService.GetAgents().Result;
140+
var agents = agentService.GetAgents(allowRouting: true).Result;
141141
var malformed = false;
142142

143143
// Sometimes it populate malformed Function in Agent name

0 commit comments

Comments
 (0)