2023-08-31 02:09:38 +00:00
|
|
|
using BotSharp.Abstraction.Conversations;
|
|
|
|
|
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;
|
2024-01-15 19:15:18 +00:00
|
|
|
using BotSharp.Abstraction.Settings;
|
2023-08-31 02:09:38 +00:00
|
|
|
|
|
|
|
|
namespace BotSharp.Plugin.RoutingSpeeder;
|
|
|
|
|
|
|
|
|
|
public class RoutingSpeederPlugin : IBotSharpPlugin
|
|
|
|
|
{
|
2024-01-12 22:20:22 +00:00
|
|
|
public string Id => "e7dff028-462d-47d2-85aa-dc56a6d362ee";
|
2023-08-31 02:09:38 +00:00
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
2024-01-15 19:15:18 +00:00
|
|
|
services.AddScoped(provider =>
|
|
|
|
|
{
|
|
|
|
|
var settingService = provider.GetRequiredService<ISettingService>();
|
|
|
|
|
return settingService.Bind<RouterSpeederSettings>("RouterSpeeder");
|
|
|
|
|
});
|
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
|
|
|
}
|
|
|
|
|
}
|