2023-08-31 02:09:38 +00:00
|
|
|
using BotSharp.Abstraction.Conversations;
|
2023-08-31 14:52:09 +00:00
|
|
|
using BotSharp.Abstraction.MLTasks;
|
2023-08-31 02:09:38 +00:00
|
|
|
using BotSharp.Abstraction.Plugins;
|
2023-08-31 14:52:09 +00:00
|
|
|
using BotSharp.Plugin.RoutingSpeeder.Settings;
|
|
|
|
|
using BotSharp.Plugin.RoutingSpeeder.Providers;
|
2023-08-31 02:09:38 +00:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Plugin.RoutingSpeeder;
|
|
|
|
|
|
|
|
|
|
public class RoutingSpeederPlugin : IBotSharpPlugin
|
|
|
|
|
{
|
|
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
2023-08-31 15:48:59 +00:00
|
|
|
var settings = new RouterSpeederSettings();
|
|
|
|
|
config.Bind("RouterSpeeder", settings);
|
2023-08-31 14:52:09 +00:00
|
|
|
services.AddSingleton(x => settings);
|
2023-08-31 15:48:59 +00:00
|
|
|
|
|
|
|
|
services.AddSingleton<ClassifierSetting>();
|
|
|
|
|
|
2023-08-31 02:09:38 +00:00
|
|
|
services.AddScoped<IConversationHook, RoutingConversationHook>();
|
2023-08-31 15:48:59 +00:00
|
|
|
services.AddSingleton<IntentClassifier>();
|
2023-08-31 02:09:38 +00:00
|
|
|
}
|
|
|
|
|
}
|