BotSharp/src/Plugins/BotSharp.Plugin.KnowledgeBase/Hooks/KnowledgeBaseUtilityHook.cs

26 lines
721 B
C#
Raw Normal View History

2024-07-17 21:03:46 +00:00
namespace BotSharp.Plugin.KnowledgeBase.Hooks;
public class KnowledgeBaseUtilityHook : IAgentUtilityHook
{
private static string PREFIX = "util-kg-";
2024-12-04 22:12:02 +00:00
private static string KNOWLEDGE_RETRIEVAL_FN = $"{PREFIX}knowledge_retrieval";
2024-11-21 06:50:55 +00:00
public void AddUtilities(List<AgentUtility> utilities)
2024-07-17 21:03:46 +00:00
{
2024-11-21 06:50:55 +00:00
var utility = new AgentUtility
{
2025-05-28 21:16:48 +00:00
Category = "knowledge",
2024-11-21 06:50:55 +00:00
Name = UtilityName.KnowledgeRetrieval,
2025-05-28 21:16:48 +00:00
Items = [
new UtilityItem
{
FunctionName = KNOWLEDGE_RETRIEVAL_FN,
TemplateName = $"{KNOWLEDGE_RETRIEVAL_FN}.fn"
}
]
2024-11-21 06:50:55 +00:00
};
utilities.Add(utility);
2024-07-17 21:03:46 +00:00
}
}