BotSharp/src/Infrastructure/BotSharp.Core/Plugins/Knowledges/KnowledgeBasePlugin.cs

19 lines
609 B
C#
Raw Normal View History

using BotSharp.Abstraction.Knowledges.Settings;
2023-06-26 23:08:24 +00:00
using BotSharp.Core.Plugins.Knowledges.Services;
using Microsoft.Extensions.Configuration;
namespace BotSharp.Core.Plugins.Knowledges;
public class KnowledgeBasePlugin : IBotSharpPlugin
{
public void RegisterDI(IServiceCollection services, IConfiguration config)
{
var settings = new KnowledgeBaseSettings();
config.Bind("KnowledgeBase", settings);
services.AddSingleton(x => settings);
services.AddScoped<ITextChopper, TextChopperService>();
services.AddScoped<IKnowledgeService, KnowledgeService>();
}
}