From 8748db4fded7483947001765bd4948be592557e0 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Tue, 16 Jan 2024 13:23:45 -0600 Subject: [PATCH] Complete plugin name and description. --- .../BotSharp.Abstraction/Plugins/Models/PluginDef.cs | 4 +++- src/Infrastructure/BotSharp.Core/Agents/AgentPlugin.cs | 1 + .../BotSharp.Core/Conversations/ConversationPlugin.cs | 1 + .../BotSharp.Core/Evaluations/EvaluationPlugin.cs | 2 ++ .../BotSharp.Core/Infrastructures/LlmProviderPlugin.cs | 1 + .../BotSharp.Core/Repository/RepositoryPlugin.cs | 2 ++ .../BotSharp.Core/Routing/RoutingPlugin.cs | 2 ++ .../BotSharp.Core/data/plugins/config.json | 3 --- .../BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs | 2 +- .../BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs | 10 +++++++++- 10 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs b/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs index 17849c18..4220b0e1 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs @@ -16,7 +16,9 @@ public class PluginDef public string[] AgentIds { get; set; } = new string[0]; [JsonPropertyName("settings_name")] - public string SettingsName => Module?.Settings?.Name; + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? SettingsName => Module?.Settings?.Name; + public IBotSharpPlugin Module { get; set; } public bool Enabled { get; set; } diff --git a/src/Infrastructure/BotSharp.Core/Agents/AgentPlugin.cs b/src/Infrastructure/BotSharp.Core/Agents/AgentPlugin.cs index 7f7dbc6f..9eec21d5 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/AgentPlugin.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/AgentPlugin.cs @@ -9,6 +9,7 @@ public class AgentPlugin : IBotSharpPlugin { public string Id => "f4b367f8-4945-476a-90a7-c3bb8e6d6e49"; public string Name => "Agent"; + public string Description => "A container of agent profile includes instruction, functions, examples and templates/ response templates."; public SettingsMeta Settings => new SettingsMeta("Agent"); diff --git a/src/Infrastructure/BotSharp.Core/Conversations/ConversationPlugin.cs b/src/Infrastructure/BotSharp.Core/Conversations/ConversationPlugin.cs index 0353cb62..00d55555 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/ConversationPlugin.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/ConversationPlugin.cs @@ -16,6 +16,7 @@ public class ConversationPlugin : IBotSharpPlugin { public string Id => "99e9b971-a9f1-4273-84da-876d2873d192"; public string Name => "Conversation"; + public string Description => "Provides conversations/ states management, saves dialogue logs, undo dialogs and channel access."; public SettingsMeta Settings => new SettingsMeta("Conversation"); diff --git a/src/Infrastructure/BotSharp.Core/Evaluations/EvaluationPlugin.cs b/src/Infrastructure/BotSharp.Core/Evaluations/EvaluationPlugin.cs index ea5c27e5..251bc591 100644 --- a/src/Infrastructure/BotSharp.Core/Evaluations/EvaluationPlugin.cs +++ b/src/Infrastructure/BotSharp.Core/Evaluations/EvaluationPlugin.cs @@ -9,6 +9,8 @@ namespace BotSharp.Core.Evaluations; public class EvaluationPlugin : IBotSharpPlugin { public string Id => "0ae251a6-7e34-403e-a333-b365d8986068"; + public string Name => "Agent Evaluation"; + public string Description => "Evaluate the created Agent and review whether the user dialogue meets design expectations."; public void RegisterDI(IServiceCollection services, IConfiguration config) { diff --git a/src/Infrastructure/BotSharp.Core/Infrastructures/LlmProviderPlugin.cs b/src/Infrastructure/BotSharp.Core/Infrastructures/LlmProviderPlugin.cs index 3e55907c..469447a2 100644 --- a/src/Infrastructure/BotSharp.Core/Infrastructures/LlmProviderPlugin.cs +++ b/src/Infrastructure/BotSharp.Core/Infrastructures/LlmProviderPlugin.cs @@ -8,6 +8,7 @@ public class LlmProviderPlugin : IBotSharpPlugin { public string Id => "0c52c0e3-cbb9-48ab-9381-260b80f018b8"; public string Name => "LLM Provider"; + public string Description => "This plugin allows you to configure multiple different model providers and switch to different models as needed."; public SettingsMeta Settings => new SettingsMeta("LlmProviders"); diff --git a/src/Infrastructure/BotSharp.Core/Repository/RepositoryPlugin.cs b/src/Infrastructure/BotSharp.Core/Repository/RepositoryPlugin.cs index 297136b5..08c67a67 100644 --- a/src/Infrastructure/BotSharp.Core/Repository/RepositoryPlugin.cs +++ b/src/Infrastructure/BotSharp.Core/Repository/RepositoryPlugin.cs @@ -7,6 +7,8 @@ namespace BotSharp.Core.Repository; public class RepositoryPlugin : IBotSharpPlugin { public string Id => "866b4b19-b4d3-479d-8e0a-98816643b8db"; + public string Name => "Data Repository"; + public string Description => "Provides a data persistence abstraction layer to store Agent and conversation-related data."; public void RegisterDI(IServiceCollection services, IConfiguration config) { diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingPlugin.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingPlugin.cs index 49bd5295..7b4dc318 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingPlugin.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingPlugin.cs @@ -12,6 +12,8 @@ namespace BotSharp.Core.Routing; public class RoutingPlugin : IBotSharpPlugin { public string Id => "87352ece-2c1c-477c-8236-2e047e11dcab"; + public string Name => "Agent Routing"; + public string Description => "Based on the conversation context, routing user request to the appropriate Agent. It's designed for complicated tasks."; public SettingsMeta Settings => new SettingsMeta("Router"); diff --git a/src/Infrastructure/BotSharp.Core/data/plugins/config.json b/src/Infrastructure/BotSharp.Core/data/plugins/config.json index ab574671..900c7225 100644 --- a/src/Infrastructure/BotSharp.Core/data/plugins/config.json +++ b/src/Infrastructure/BotSharp.Core/data/plugins/config.json @@ -1,9 +1,6 @@ { "Comment": "User can change this configuration dynamically and reflect updates to UI.", "EnabledPlugins": [ - "058094a7-4ad3-4284-b94d-ac1373cf63d8", - "65185362-392c-44fd-a023-95a198824436", - "5b18ca9b-82ed-494b-b121-e3499661edb0", "6e52d42d-1e23-406b-8599-36af36c83209" ] } \ No newline at end of file diff --git a/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs b/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs index a067eb09..2fc57fb8 100644 --- a/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs +++ b/src/Plugins/BotSharp.Plugin.AzureOpenAI/AzureOpenAiPlugin.cs @@ -17,7 +17,7 @@ public class AzureOpenAiPlugin : IBotSharpPlugin { public string Id => "65185362-392c-44fd-a023-95a198824436"; public string Name => "Azure OpenAI"; - public string Description => "Azure OpenAI Service (ChatGPT 3.5 Turbo / 4.0)"; + public string Description => "Azure OpenAI Service including text generation, text to image and other AI services."; public string IconUrl => "https://nanfor.com/cdn/shop/files/cursos-propios-Azure-openAI.jpg?v=1692877741"; public void RegisterDI(IServiceCollection services, IConfiguration config) diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs index dadacb4c..619e78c5 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/MongoStoragePlugin.cs @@ -1,3 +1,4 @@ +using BotSharp.Abstraction.Plugins.Models; using BotSharp.Plugin.MongoStorage.Repository; namespace BotSharp.Plugin.MongoStorage; @@ -9,7 +10,7 @@ public class MongoStoragePlugin : IBotSharpPlugin { public string Id => "058094a7-4ad3-4284-b94d-ac1373cf63d8"; public string Name => "MongoDB Storage"; - public string Description => "MongoDB as the repository, store data in document."; + public string Description => "MongoDB as the repository, store data in document DB. It is suitable for production-level systems."; public string IconUrl => "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRrFrT-_0VYV4PraApwSUmsf4pBGWgvLTaLZGUd7942FxjErsA5iaL4n5Q7CplOmVtwEQ&usqp=CAU"; public void RegisterDI(IServiceCollection services, IConfiguration config) @@ -28,4 +29,11 @@ public class MongoStoragePlugin : IBotSharpPlugin services.AddScoped(); } } + + public bool AttachMenu(List menu) + { + var section = menu.First(x => x.Label == "Apps"); + menu.Add(new PluginMenuDef("MongoDB", icon: "bx bx-data", link: "/page/mongodb", weight: section.Weight + 10)); + return true; + } }