BotSharp/src/Plugins/BotSharp.Plugin.RoutingSpeeder/RoutingSpeederPlugin.cs

28 lines
956 B
C#
Raw Normal View History

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;
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)
{
services.AddScoped(provider =>
{
var settingService = provider.GetRequiredService<ISettingService>();
return settingService.Bind<RouterSpeederSettings>("RouterSpeeder");
});
services.AddSingleton<ClassifierSetting>();
2023-08-31 02:09:38 +00:00
services.AddScoped<IConversationHook, RoutingConversationHook>();
services.AddSingleton<IntentClassifier>();
2023-08-31 02:09:38 +00:00
}
}