Merge branch 'SciSharp:master' into master

This commit is contained in:
Haiping 2025-01-26 21:07:37 -06:00 committed by GitHub
commit 4da1b90c07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -1,6 +1,7 @@
using BotSharp.Abstraction.MLTasks;
using BotSharp.Abstraction.Plugins.Models;
using BotSharp.Abstraction.Settings;
using BotSharp.Abstraction.Statistics.Settings;
using BotSharp.Abstraction.Templating;
using BotSharp.Abstraction.Users.Enums;
using BotSharp.Core.Agents.Hooks;
@ -34,6 +35,12 @@ public class AgentPlugin : IBotSharpPlugin
services.AddScoped<IAgentHook, BasicAgentHook>();
services.AddScoped<IBotSharpStatService, BotSharpStatService>();
services.AddScoped(provider =>
{
var settingService = provider.GetRequiredService<ISettingService>();
return settingService.Bind<StatisticsSettings>("Statistics");
});
services.AddScoped(provider =>
{
var settingService = provider.GetRequiredService<ISettingService>();

View file

@ -16,11 +16,6 @@ public class DashboardPlugin : IBotSharpPlugin
public void RegisterDI(IServiceCollection services, IConfiguration config)
{
services.AddScoped<IConversationHook, StatsConversationHook>();
services.AddScoped(provider =>
{
var settingService = provider.GetRequiredService<ISettingService>();
return settingService.Bind<StatisticsSettings>("Statistics");
});
}
public bool AttachMenu(List<PluginMenuDef> menu)