using BotSharp.Abstraction.Plugins.Models; using BotSharp.Abstraction.Settings; using BotSharp.Plugin.KnowledgeBase.Hooks; using Microsoft.Extensions.Configuration; namespace BotSharp.Plugin.KnowledgeBase; public class KnowledgeBasePlugin : IBotSharpPlugin { public string Id => "f1625e9f-8de5-467b-b230-556364d8b117"; public string Name => "Knowledge Base"; public string Description => "Embedding private data and feed them into LLM in the conversation."; public string IconUrl => "https://cdn-icons-png.flaticon.com/512/9592/9592995.png"; public void RegisterDI(IServiceCollection services, IConfiguration config) { services.AddScoped(provider => { var settingService = provider.GetRequiredService(); return settingService.Bind("KnowledgeBase"); }); var a = config["KnowledgeBase"]; services.AddScoped(); services.AddScoped(); services.AddSingleton(); services.AddScoped(); services.AddScoped(); } public bool AttachMenu(List menu) { var section = menu.First(x => x.Label == "Apps"); menu.Add(new PluginMenuDef("Knowledge Base", link: "/page/knowledge-base", icon: "bx bx-book-open", weight: section.Weight + 1)); return true; } }