2023-08-31 15:48:59 +00:00
|
|
|
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>();
|
|
|
|
|
}
|
|
|
|
|
}
|