Add disabled property to routing table.

This commit is contained in:
hchen2020 2023-08-27 06:07:22 -05:00
parent 7e95be00ef
commit e4d8524376
3 changed files with 10 additions and 1 deletions

View file

@ -19,6 +19,9 @@ public class RoutingRecord
[JsonPropertyName("redirect_to")]
public string RedirectTo { get; set; }
[JsonPropertyName("disabled")]
public bool Disabled { get; set; }
public override string ToString()
{
return Name;

View file

@ -82,4 +82,8 @@
<ProjectReference Include="..\BotSharp.Abstraction\BotSharp.Abstraction.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Reasoning\" />
</ItemGroup>
</Project>

View file

@ -10,7 +10,9 @@ public class AgentHook : AgentHookBase
public override bool OnInstructionLoaded(string template, Dictionary<string, object> dict)
{
var router = _services.GetRequiredService<IAgentRouting>();
dict["routing_records"] = router.GetRoutingRecords();
dict["routing_records"] = router.GetRoutingRecords()
.Where(x => !x.Disabled)
.ToList();
return true;
}
}