diff --git a/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs b/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs index 1b3d21da..eb1b31af 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs @@ -5,5 +5,7 @@ namespace BotSharp.Abstraction.Plugins; public interface IBotSharpPlugin { + string Name => ""; + string Description => ""; void RegisterDI(IServiceCollection services, IConfiguration config); } diff --git a/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs b/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs index 0dae5b92..3f28d22c 100644 --- a/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs +++ b/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs @@ -1,5 +1,6 @@ using BotSharp.Abstraction.Plugins.Models; using Microsoft.AspNetCore.Builder; +using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.Extensions.Configuration; using System.Drawing; using System.IO; @@ -45,20 +46,21 @@ public class PluginLoader foreach (var module in modules) { module.RegisterDI(_services, _config); - string classSummary = GetSummaryComment(module.GetType()); + // string classSummary = GetSummaryComment(module.GetType()); + var name = string.IsNullOrEmpty(module.Name) ? module.GetType().Name : module.Name; _modules.Add(module); _plugins.Add(new PluginDef { - Name = module.GetType().Name, - Description = classSummary, + Name = name, + Description = module.Description, Assembly = assemblyName }); Console.Write($"Loaded plugin "); - Console.Write(module.GetType().Name, Color.Green); + Console.Write(name, Color.Green); Console.WriteLine($" from {assemblyName}."); - if (!string.IsNullOrEmpty(classSummary)) + if (!string.IsNullOrEmpty(module.Description)) { - Console.WriteLine(classSummary); + Console.WriteLine(module.Description); } } diff --git a/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs b/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs index 5a4047c9..d5baff1e 100644 --- a/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs +++ b/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs @@ -14,6 +14,9 @@ namespace BotSharp.Platform.AzureAi; /// public class AzureOpenAiPlugin : IBotSharpPlugin { + public string Name => "Azure OpenAI"; + public string Description => "Azure OpenAI Service"; + public void RegisterDI(IServiceCollection services, IConfiguration config) { var settings = new AzureOpenAiSettings(); diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs index d5b9e206..5fd26d15 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs @@ -7,6 +7,9 @@ namespace BotSharp.Plugin.MongoStorage; /// public class MongoStoragePlugin : IBotSharpPlugin { + public string Name => "MongoDB Storage"; + public string Description => "MongoDB as the repository"; + public void RegisterDI(IServiceCollection services, IConfiguration config) { var dbSettings = new BotSharpDatabaseSettings();