Fix GetAgents list.
This commit is contained in:
parent
758cfd556e
commit
7fb9440011
|
|
@ -7,7 +7,7 @@ public interface IAgentService
|
||||||
{
|
{
|
||||||
Task<Agent> CreateAgent(Agent agent);
|
Task<Agent> CreateAgent(Agent agent);
|
||||||
Task RefreshAgents();
|
Task RefreshAgents();
|
||||||
Task<List<Agent>> GetAgents();
|
Task<List<Agent>> GetAgents(bool? allowRouting = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load agent configurations and trigger hooks
|
/// Load agent configurations and trigger hooks
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ public partial class AgentService
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
[MemoryCache(10 * 60)]
|
[MemoryCache(10 * 60)]
|
||||||
#endif
|
#endif
|
||||||
public async Task<List<Agent>> GetAgents()
|
public async Task<List<Agent>> GetAgents(bool? allowRouting = null)
|
||||||
{
|
{
|
||||||
var agents = _db.GetAgentsByUser(_user.Id);
|
var agents = _db.GetAgents(allowRouting: allowRouting);
|
||||||
return await Task.FromResult(agents);
|
return await Task.FromResult(agents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ public partial class RoutingService
|
||||||
private void FixMalformedResponse(FunctionCallFromLlm args)
|
private void FixMalformedResponse(FunctionCallFromLlm args)
|
||||||
{
|
{
|
||||||
var agentService = _services.GetRequiredService<IAgentService>();
|
var agentService = _services.GetRequiredService<IAgentService>();
|
||||||
var agents = agentService.GetAgents().Result;
|
var agents = agentService.GetAgents(allowRouting: true).Result;
|
||||||
var malformed = false;
|
var malformed = false;
|
||||||
|
|
||||||
// Sometimes it populate malformed Function in Agent name
|
// Sometimes it populate malformed Function in Agent name
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue