From 40c800d1a4c5fe8da00ba45aca1cb7890aa2078c Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Sat, 13 Jan 2024 15:35:52 -0600 Subject: [PATCH] Set defalut icon url as null. --- .../Plugins/IBotSharpPlugin.cs | 2 +- .../Plugins/Models/PluginDef.cs | 2 +- .../instruction.liquid | 175 +----------------- 3 files changed, 3 insertions(+), 176 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs b/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs index 9ce98003..dd5deb12 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Plugins/IBotSharpPlugin.cs @@ -12,7 +12,7 @@ public interface IBotSharpPlugin string Id { get; } string Name => ""; string Description => ""; - string IconUrl => "https://avatars.githubusercontent.com/u/44989469?s=200&v=4"; + string? IconUrl => null; /// /// Has build-in agent profile with this plugin diff --git a/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs b/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs index c14c03d4..5274c556 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginDef.cs @@ -7,7 +7,7 @@ public class PluginDef public string Description { get; set; } public string Assembly { get; set; } [JsonPropertyName("icon_url")] - public string IconUrl { get; set; } + public string? IconUrl { get; set; } [JsonPropertyName("agent_ids")] public string[] AgentIds { get; set; } diff --git a/src/Plugins/BotSharp.Plugin.SqlDriver/data/agents/beda4c12-e1ec-4b4b-b328-3df4a6687c4f/instruction.liquid b/src/Plugins/BotSharp.Plugin.SqlDriver/data/agents/beda4c12-e1ec-4b4b-b328-3df4a6687c4f/instruction.liquid index 24966b0e..eded4c7b 100644 --- a/src/Plugins/BotSharp.Plugin.SqlDriver/data/agents/beda4c12-e1ec-4b4b-b328-3df4a6687c4f/instruction.liquid +++ b/src/Plugins/BotSharp.Plugin.SqlDriver/data/agents/beda4c12-e1ec-4b4b-b328-3df4a6687c4f/instruction.liquid @@ -5,177 +5,4 @@ Follow these steps: 2: Translate user requirements into SQL statements step by step. 3: Double check, don't miss any requirements, all the parameters must have values. 4: Confirm with the user whether to execute the sql statement. - If user confirms to run the query, call function execute_sql to execute it. - - -Table structure guideline: -Table with prefix "data_" represents system enum item. -Table with prefix "client_" represents client specific configuration or client dataset. - -Below are the table DDL information in JSON format: - -CREATE TABLE `data_ServiceCategory` ( - `Id` smallint(6) NOT NULL, - `Name` varchar(50) NOT NULL, - `IsClientVisible` tinyint(1) NOT NULL DEFAULT '1', - `IsTurnService` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - KEY `ID_data_ServiceCategory_Name` (`Name`) -) - -CREATE TABLE `data_ServiceType` ( - `Id` smallint(6) NOT NULL, - `Name` varchar(50) NOT NULL, - `ServcieCategoryId` smallint(6) NOT NULL, - PRIMARY KEY (`Id`), - KEY `FK_data_ServiceType_ServcieCategoryId` (`ServcieCategoryId`), - CONSTRAINT `FK_data_ServiceType_ServcieCategoryId` FOREIGN KEY (`ServcieCategoryId`) REFERENCES `data_ServiceCategory` (`Id`) -) - -CREATE TABLE `data_ServiceCode` ( - `Id` smallint(6) NOT NULL, - `Name` varchar(100) NOT NULL, - `ServiceTypeId` smallint(6) NOT NULL, - `AbbrName` varchar(100) DEFAULT NULL, - `IsClientVisible` tinyint(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`Id`), - KEY `FK_data_ServiceCode_ServiceCodeId` (`ServiceTypeId`), - KEY `FK_data_ServiceCode_SkillLevelId` (`SkillLevelId`), - CONSTRAINT `FK_data_ServiceCode_ServiceCodeId` FOREIGN KEY (`ServiceTypeId`) REFERENCES `data_ServiceType` (`Id`), - CONSTRAINT `FK_data_ServiceCode_SkillLevelId` FOREIGN KEY (`SkillLevelId`) REFERENCES `data_SkillLevel` (`Id`) -) - -CREATE TABLE `client_ServiceCode` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ClientServiceTypeId` int(10) unsigned NOT NULL, - `ServiceCodeId` smallint(6) NOT NULL, - `IsContract` tinyint(1) DEFAULT '0', - `IsHidden` tinyint(1) DEFAULT '0', - `IsPersonal` tinyint(1) NOT NULL DEFAULT '0', - `IsHiddenForClient` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_client_ServiceCode` (`ClientServiceTypeId`,`ServiceCodeId`,`IsPersonal`), - KEY `FK_client_ServiceCode_ServiceCodeId_idx` (`ServiceCodeId`), - CONSTRAINT `FK_client_ServiceCode_ClientServiceTypeId` FOREIGN KEY (`ClientServiceTypeId`) REFERENCES `client_ServiceType` (`Id`), - CONSTRAINT `FK_client_ServiceCode_ServiceCodeId` FOREIGN KEY (`ServiceCodeId`) REFERENCES `data_ServiceCode` (`Id`) -) - -CREATE TABLE `client_ServiceType` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ClientServiceCategoryId` int(10) unsigned NOT NULL, - `ServiceTypeId` smallint(6) NOT NULL, - `IsHidden` tinyint(1) DEFAULT '0', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_client_ServiceType` (`ClientServiceCategoryId`,`ServiceTypeId`), - KEY `FK_client_ServiceType_ServiceTypeId` (`ServiceTypeId`), - CONSTRAINT `FK_client_ServiceType_ClientServiceCategoryId` FOREIGN KEY (`ClientServiceCategoryId`) REFERENCES `client_ServiceCategory` (`Id`), - CONSTRAINT `FK_client_ServiceType_ServiceTypeId` FOREIGN KEY (`ServiceTypeId`) REFERENCES `data_ServiceType` (`Id`) -) - -CREATE TABLE `client_ServiceCategory` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ClientId` int(10) unsigned NOT NULL, - `ServiceCategoryId` smallint(6) NOT NULL, - `IsHidden` tinyint(1) DEFAULT '0', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_client_ServiceCategory` (`ClientId`,`ServiceCategoryId`), - KEY `FK_client_ServiceCategory_ServiceCategoryId` (`ServiceCategoryId`), - CONSTRAINT `FK_client_ServiceCategory_ClientId` FOREIGN KEY (`ClientId`) REFERENCES `client_Profile` (`Id`), - CONSTRAINT `FK_client_ServiceCategory_ServiceCategoryId` FOREIGN KEY (`ServiceCategoryId`) REFERENCES `data_ServiceCategory` (`Id`) -) - -CREATE TABLE `client_Profile` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `Name` varchar(100) NOT NULL, - `Active` tinyint(1) NOT NULL DEFAULT '1', - `ClientCode` varchar(20) DEFAULT NULL, - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_client_Profile` (`ClientCode`), - KEY `FK_client_Location_CustomerTypeId` (`CustomerTypeId`), - KEY `IDX_client_Profile_BusinessTypeId` (`BusinessTypeId`), - CONSTRAINT `FK_client_Location_CustomerTypeId` FOREIGN KEY (`CustomerTypeId`) REFERENCES `data_CustomerType` (`Id`) -) - -CREATE TABLE `client_WOReactive` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `WONum` varchar(40) NOT NULL, - `LocationId` int(10) unsigned NOT NULL, - `AffiliateId` int(10) unsigned DEFAULT NULL, - `ServiceCodeId` smallint(6) NOT NULL, - `StatusId` smallint(6) NOT NULL, - `ClientNTE` decimal(18,2) DEFAULT NULL, - `ReferWONum` varchar(512) DEFAULT NULL, - `WOCategoryId` smallint(6) DEFAULT NULL, - `WOTypeId` smallint(6) DEFAULT NULL, - `WOServiceCategoryId` smallint(6) DEFAULT NULL, - `WOServiceTypeId` smallint(6) DEFAULT NULL, - `WOClientId` int(10) unsigned DEFAULT NULL - PRIMARY KEY (`Id`), - CONSTRAINT `FK_client_WOReactive_ServiceCodeId` FOREIGN KEY (`ServiceCodeId`) REFERENCES `data_ServiceCode` (`Id`), - CONSTRAINT `FK_client_WOReactive_StatusId` FOREIGN KEY (`StatusId`) REFERENCES `data_WOStatus` (`Id`), - CONSTRAINT `FK_client_WOReactive_WOCategoryId` FOREIGN KEY (`WOCategoryId`) REFERENCES `data_WOCategory` (`Id`), - CONSTRAINT `FK_client_WOReactive_WOTypeId` FOREIGN KEY (`WOTypeId`) REFERENCES `data_WOType` (`Id`) -) - -CREATE TABLE `client_ServiceCodeNTE` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ClientServiceCodeId` int(10) unsigned NOT NULL, - `ClientNTE` decimal(18,2) DEFAULT NULL, - `AffiliateNTE` decimal(18,2) DEFAULT NULL, - PRIMARY KEY (`Id`), - CONSTRAINT `FK_client_ServiceCodeNTE_ClientServiceCodeId` FOREIGN KEY (`ClientServiceCodeId`) REFERENCES `client_ServiceCode` (`Id`) -) - -CREATE TABLE `data_Priority` ( - `Id` smallint(6) NOT NULL, - `Name` varchar(50) NOT NULL, - `AbbrName` varchar(50) NOT NULL, - PRIMARY KEY (`Id`) - ) - - CREATE TABLE `data_Trade` ( - `Id` smallint(6) NOT NULL, - `Name` varchar(50) NOT NULL, - PRIMARY KEY (`Id`), - KEY `ID_data_Trade_Name` (`Name`) - ) - - CREATE TABLE `data_TradeServiceCode` ( - `Id` int(10) NOT NULL AUTO_INCREMENT, - `TradeId` smallint(6) NOT NULL, - `ServiceCodeId` smallint(6) NOT NULL, - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_data_TradeServiceCode` (`ServiceCodeId`,`CustomerTypeId`), - KEY `FK_data_TradeServiceCode_TradeId` (`TradeId`), - KEY `FK_data_TradeServiceCode_ServiceCodeId` (`ServiceCodeId`), - CONSTRAINT `FK_data_TradeServiceCode_ServiceCodeId` FOREIGN KEY (`ServiceCodeId`) REFERENCES `data_ServiceCode` (`Id`), - CONSTRAINT `FK_data_TradeServiceCode_TradeId` FOREIGN KEY (`TradeId`) REFERENCES `data_Trade` (`Id`) - ) - -CREATE TABLE `Client_ServiceCodePriority` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ClientServiceCodeId` int(10) unsigned NOT NULL, - `PriorityId` smallint(6) NOT NULL, - PRIMARY KEY (`Id`), - CONSTRAINT `FK_Client_ServiceCodePriority_ClientServiceCodeId` FOREIGN KEY (`ClientServiceCodeId`) REFERENCES `client_ServiceCode` (`Id`), - CONSTRAINT `FK_Client_ServiceCodePriority_PriorityId` FOREIGN KEY (`PriorityId`) REFERENCES `data_Priority` (`Id`) -) - - -==== -User Task: - -Find all the NTE for all the service combination of client 'IH'. -Out put the service combination and NTE and priority. - -==== -Examples: - -user: Create a new service category named 'DSC Equipment' for client 'Signet'. -assistant: Steps: 1. Check if the service category is in data_ServiceCategory. - 2. If exists, get the service category id from data_ServiceCategory. - 3. If not exists, insert a new record and get the id. - 4. Insert a new record to client_ServiceCategory based on the FOREIGN KEY and REFERENCES. - -user: Create a new service type and service code. -assistant: You can follow the process same as service category creation. \ No newline at end of file + If user confirms to run the query, call function execute_sql to execute it. \ No newline at end of file