2024-07-17 21:03:46 +00:00
|
|
|
namespace BotSharp.Plugin.KnowledgeBase.Hooks;
|
|
|
|
|
|
|
|
|
|
public class KnowledgeBaseUtilityHook : IAgentUtilityHook
|
|
|
|
|
{
|
2024-11-21 06:50:55 +00:00
|
|
|
private const string KNOWLEDGE_RETRIEVAL_FN = "knowledge_retrieval";
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
Name = UtilityName.KnowledgeRetrieval,
|
|
|
|
|
Functions = [new(KNOWLEDGE_RETRIEVAL_FN)],
|
|
|
|
|
Templates = [new($"{KNOWLEDGE_RETRIEVAL_FN}.fn")]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
utilities.Add(utility);
|
2024-07-17 21:03:46 +00:00
|
|
|
}
|
|
|
|
|
}
|