From a4be554d6c02240e21c1bbfff6148cdaeb13524d Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 3 Oct 2018 12:21:19 -0500 Subject: [PATCH] fix training issue --- BotSharp.Core/Abstractions/INlpPredict.cs | 1 + BotSharp.Core/Abstractions/INlpProvider.cs | 1 + BotSharp.Core/Abstractions/INlpTrain.cs | 1 + BotSharp.Core/AgentStorageInRedis.cs | 8 ++++- BotSharp.Core/Engines/BotPredictor.cs | 1 + .../Engines/BotSharp/BotSharpCRFNer.cs | 1 + .../BotSharp/BotSharpIntentClassifier.cs | 1 + .../{BotSharpAi.cs => BotSharpNLU.cs} | 2 +- .../Engines/BotSharp/BotSharpProvider.cs | 1 + .../Engines/BotSharp/BotSharpTagger.cs | 1 + .../Engines/BotSharp/BotSharpTokenizer.cs | 1 + BotSharp.Core/Engines/BotTrainer.cs | 7 ++-- .../IPlatformBuilder.cs | 3 +- .../MachineLearning}/ModelMetaData.cs | 7 ++-- .../MachineLearning}/PipeModel.cs | 7 ++-- BotSharp.RestApi/BotSharp.RestApi.csproj | 3 +- BotSharp.WebHost/BotSharp.WebHost.csproj | 2 +- BotSharp.WebHost/Program.cs | 6 ---- BotSharp.WebHost/Settings/ArticulateAi.json | 35 ++----------------- BotSharp.WebHost/Settings/BotSharpAi.json | 34 ------------------ BotSharp.WebHost/Settings/BotSharpNLU.json | 35 +++++++++++++++++++ BotSharp.WebHost/Settings/DialogflowAi.json | 35 ++----------------- BotSharp.WebHost/Settings/app.json | 10 +++--- BotSharp.WebHost/Startup.cs | 32 +++++++++-------- Platform.Articulate/ArticulateAi.cs | 5 +-- 25 files changed, 101 insertions(+), 139 deletions(-) rename BotSharp.Core/Engines/BotSharp/{BotSharpAi.cs => BotSharpNLU.cs} (88%) rename {BotSharp.Core/Engines => BotSharp.Platform.Models/MachineLearning}/ModelMetaData.cs (80%) rename {BotSharp.Core/Engines => BotSharp.Platform.Models/MachineLearning}/PipeModel.cs (80%) delete mode 100644 BotSharp.WebHost/Settings/BotSharpAi.json create mode 100644 BotSharp.WebHost/Settings/BotSharpNLU.json diff --git a/BotSharp.Core/Abstractions/INlpPredict.cs b/BotSharp.Core/Abstractions/INlpPredict.cs index d6b76f98..9d7d76c8 100644 --- a/BotSharp.Core/Abstractions/INlpPredict.cs +++ b/BotSharp.Core/Abstractions/INlpPredict.cs @@ -1,5 +1,6 @@ using BotSharp.Core.Engines; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using System; using System.Collections.Generic; using System.Text; diff --git a/BotSharp.Core/Abstractions/INlpProvider.cs b/BotSharp.Core/Abstractions/INlpProvider.cs index 93bb24b7..64ea5501 100644 --- a/BotSharp.Core/Abstractions/INlpProvider.cs +++ b/BotSharp.Core/Abstractions/INlpProvider.cs @@ -1,5 +1,6 @@ using BotSharp.Core.Engines; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using System; using System.Collections.Generic; using System.Text; diff --git a/BotSharp.Core/Abstractions/INlpTrain.cs b/BotSharp.Core/Abstractions/INlpTrain.cs index 218c5a6e..40204732 100644 --- a/BotSharp.Core/Abstractions/INlpTrain.cs +++ b/BotSharp.Core/Abstractions/INlpTrain.cs @@ -1,5 +1,6 @@ using BotSharp.Core.Engines; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using System; using System.Collections.Generic; using System.Text; diff --git a/BotSharp.Core/AgentStorageInRedis.cs b/BotSharp.Core/AgentStorageInRedis.cs index f02accd1..9b29a440 100644 --- a/BotSharp.Core/AgentStorageInRedis.cs +++ b/BotSharp.Core/AgentStorageInRedis.cs @@ -69,7 +69,13 @@ namespace BotSharp.Core agent.Id = Guid.NewGuid().ToString(); } - csredis.Set(agent.Id, JsonConvert.SerializeObject(agent)); + var json = JsonConvert.SerializeObject(agent, new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + Formatting = Formatting.Indented, + }); + + csredis.Set(agent.Id, json); return true; } diff --git a/BotSharp.Core/Engines/BotPredictor.cs b/BotSharp.Core/Engines/BotPredictor.cs index df8ebf21..da8b05ed 100644 --- a/BotSharp.Core/Engines/BotPredictor.cs +++ b/BotSharp.Core/Engines/BotPredictor.cs @@ -1,6 +1,7 @@ using BotSharp.Core.Abstractions; using BotSharp.Platform.Models; using BotSharp.Platform.Models.AiRequest; +using BotSharp.Platform.Models.MachineLearning; using DotNetToolkit; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; diff --git a/BotSharp.Core/Engines/BotSharp/BotSharpCRFNer.cs b/BotSharp.Core/Engines/BotSharp/BotSharpCRFNer.cs index f163047f..9e6c6a90 100644 --- a/BotSharp.Core/Engines/BotSharp/BotSharpCRFNer.cs +++ b/BotSharp.Core/Engines/BotSharp/BotSharpCRFNer.cs @@ -13,6 +13,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; namespace BotSharp.Core.Engines.BotSharp { diff --git a/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs b/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs index 9810289d..acdcc983 100644 --- a/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs +++ b/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs @@ -3,6 +3,7 @@ using BotSharp.NLP; using BotSharp.NLP.Classify; using BotSharp.NLP.Txt2Vec; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using Microsoft.Extensions.Configuration; using Newtonsoft.Json.Linq; using System; diff --git a/BotSharp.Core/Engines/BotSharp/BotSharpAi.cs b/BotSharp.Core/Engines/BotSharp/BotSharpNLU.cs similarity index 88% rename from BotSharp.Core/Engines/BotSharp/BotSharpAi.cs rename to BotSharp.Core/Engines/BotSharp/BotSharpNLU.cs index 963e7b6e..9ce3142e 100644 --- a/BotSharp.Core/Engines/BotSharp/BotSharpAi.cs +++ b/BotSharp.Core/Engines/BotSharp/BotSharpNLU.cs @@ -7,7 +7,7 @@ using BotSharp.Platform.Models; namespace BotSharp.Core.Engines.BotSharp { - public class BotSharpAi : BotEngineBase, IBotEngine + public class BotSharpNLU : BotEngineBase, IBotEngine { public override async Task Train(BotTrainOptions options) { diff --git a/BotSharp.Core/Engines/BotSharp/BotSharpProvider.cs b/BotSharp.Core/Engines/BotSharp/BotSharpProvider.cs index 4926cfbf..490e2820 100644 --- a/BotSharp.Core/Engines/BotSharp/BotSharpProvider.cs +++ b/BotSharp.Core/Engines/BotSharp/BotSharpProvider.cs @@ -1,5 +1,6 @@ using BotSharp.Core.Abstractions; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using Microsoft.Extensions.Configuration; using Newtonsoft.Json.Linq; using System; diff --git a/BotSharp.Core/Engines/BotSharp/BotSharpTagger.cs b/BotSharp.Core/Engines/BotSharp/BotSharpTagger.cs index 2a45a01d..30d25150 100644 --- a/BotSharp.Core/Engines/BotSharp/BotSharpTagger.cs +++ b/BotSharp.Core/Engines/BotSharp/BotSharpTagger.cs @@ -4,6 +4,7 @@ using BotSharp.NLP.Corpus; using BotSharp.NLP.Tag; using BotSharp.NLP.Tokenize; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using Microsoft.Extensions.Configuration; using System; using System.Collections.Generic; diff --git a/BotSharp.Core/Engines/BotSharp/BotSharpTokenizer.cs b/BotSharp.Core/Engines/BotSharp/BotSharpTokenizer.cs index 1d72057a..835a4d59 100644 --- a/BotSharp.Core/Engines/BotSharp/BotSharpTokenizer.cs +++ b/BotSharp.Core/Engines/BotSharp/BotSharpTokenizer.cs @@ -2,6 +2,7 @@ using BotSharp.NLP; using BotSharp.NLP.Tokenize; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using Microsoft.Extensions.Configuration; using System; using System.Collections.Generic; diff --git a/BotSharp.Core/Engines/BotTrainer.cs b/BotSharp.Core/Engines/BotTrainer.cs index 3010d5f4..91661cde 100644 --- a/BotSharp.Core/Engines/BotTrainer.cs +++ b/BotSharp.Core/Engines/BotTrainer.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using BotSharp.Core.Abstractions; using BotSharp.Platform.Models; +using BotSharp.Platform.Models.MachineLearning; using DotNetToolkit; using EntityFrameworkCore.BootKit; using Microsoft.EntityFrameworkCore; @@ -39,7 +40,8 @@ namespace BotSharp.Core.Engines // Get NLP Provider var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); var assemblies = (string[])AppDomain.CurrentDomain.GetData("Assemblies"); - var engine = config.GetSection($"BotEngine").Value; + var platform = config.GetSection($"platform").Value; + var engine = config.GetSection($"{platform}:botEngine").Value; string providerName = config.GetSection($"{engine}:Provider").Value; var provider = TypeHelper.GetInstance(providerName, assemblies) as INlpProvider; provider.Configuration = config.GetSection(engine); @@ -73,7 +75,8 @@ namespace BotSharp.Core.Engines var meta = new ModelMetaData { - Platform = engine, + Platform = platform, + BotEngine = engine, Language = agent.Language, TrainingDate = DateTime.UtcNow, Version = config.GetValue($"Version"), diff --git a/BotSharp.Platform.Abstraction/IPlatformBuilder.cs b/BotSharp.Platform.Abstraction/IPlatformBuilder.cs index 4f16e3fe..c04b98be 100644 --- a/BotSharp.Platform.Abstraction/IPlatformBuilder.cs +++ b/BotSharp.Platform.Abstraction/IPlatformBuilder.cs @@ -1,6 +1,7 @@ using BotSharp.Platform.Models; using BotSharp.Platform.Models.AiRequest; using BotSharp.Platform.Models.AiResponse; +using BotSharp.Platform.Models.MachineLearning; using System; using System.Collections.Generic; using System.Text; @@ -47,7 +48,7 @@ namespace BotSharp.Platform.Abstraction /// bool SaveAgent(TAgent agent); - Task Train(TAgent agent, TrainingCorpus corpus); + Task Train(TAgent agent, TrainingCorpus corpus); AiResponse TextRequest(AiRequest request); } diff --git a/BotSharp.Core/Engines/ModelMetaData.cs b/BotSharp.Platform.Models/MachineLearning/ModelMetaData.cs similarity index 80% rename from BotSharp.Core/Engines/ModelMetaData.cs rename to BotSharp.Platform.Models/MachineLearning/ModelMetaData.cs index 09cd8fb1..a79ea0d2 100644 --- a/BotSharp.Core/Engines/ModelMetaData.cs +++ b/BotSharp.Platform.Models/MachineLearning/ModelMetaData.cs @@ -1,13 +1,13 @@ -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Text; -namespace BotSharp.Core.Engines +namespace BotSharp.Platform.Models.MachineLearning { public class ModelMetaData { public string Platform { get; set; } + public string BotEngine { get; set; } public string Language { get; set; } public string Version { get; set; } @@ -16,7 +16,6 @@ namespace BotSharp.Core.Engines /// /// Model file fullpath /// - [JsonIgnore] public string Model { get; set; } public List Pipeline { get; set; } diff --git a/BotSharp.Core/Engines/PipeModel.cs b/BotSharp.Platform.Models/MachineLearning/PipeModel.cs similarity index 80% rename from BotSharp.Core/Engines/PipeModel.cs rename to BotSharp.Platform.Models/MachineLearning/PipeModel.cs index d971408a..7d753514 100644 --- a/BotSharp.Core/Engines/PipeModel.cs +++ b/BotSharp.Platform.Models/MachineLearning/PipeModel.cs @@ -1,9 +1,8 @@ -using Newtonsoft.Json.Linq; -using System; +using System; using System.Collections.Generic; using System.Text; -namespace BotSharp.Core.Engines +namespace BotSharp.Platform.Models.MachineLearning { public class PipeModel { @@ -24,6 +23,6 @@ namespace BotSharp.Core.Engines /// /// Extra meta data according to pipe /// - public JObject Meta { get; set; } + public Object Meta { get; set; } } } diff --git a/BotSharp.RestApi/BotSharp.RestApi.csproj b/BotSharp.RestApi/BotSharp.RestApi.csproj index 4c2f5f6c..34a143fd 100644 --- a/BotSharp.RestApi/BotSharp.RestApi.csproj +++ b/BotSharp.RestApi/BotSharp.RestApi.csproj @@ -20,8 +20,9 @@ - C:\Users\haipi\Documents\Projects\BotSharp\BotSharp.RestApi\BotSharp.RestApi.xml + bin\Debug\netstandard2.0\BotSharp.RestApi.xml TRACE;DEBUG + diff --git a/BotSharp.WebHost/BotSharp.WebHost.csproj b/BotSharp.WebHost/BotSharp.WebHost.csproj index 59cdf173..451892f0 100644 --- a/BotSharp.WebHost/BotSharp.WebHost.csproj +++ b/BotSharp.WebHost/BotSharp.WebHost.csproj @@ -91,7 +91,7 @@ PreserveNewest - + PreserveNewest diff --git a/BotSharp.WebHost/Program.cs b/BotSharp.WebHost/Program.cs index 34198d19..57d70b4a 100644 --- a/BotSharp.WebHost/Program.cs +++ b/BotSharp.WebHost/Program.cs @@ -44,13 +44,7 @@ namespace BotSharp.WebHost config.AddJsonFile(setting, optional: false, reloadOnChange: true); }); }) -#if ARTICULATE - .UseUrls("http://0.0.0.0:7500") -#elif RASA - .UseUrls("http://0.0.0.0:5000") -#else .UseUrls("http://0.0.0.0:3112") -#endif .UseStartup() .Build(); } diff --git a/BotSharp.WebHost/Settings/ArticulateAi.json b/BotSharp.WebHost/Settings/ArticulateAi.json index 0ff12242..81cff34e 100644 --- a/BotSharp.WebHost/Settings/ArticulateAi.json +++ b/BotSharp.WebHost/Settings/ArticulateAi.json @@ -1,36 +1,7 @@ { - "ArticulateAi": { - "Lang": "en", + "articulateAi": { + "botEngine": "BotSharpNLU", - "AgentStorage": "AgentStorageInRedis", - - "Provider": "BotSharpProvider", - "BotSharpProvider": { - }, - - "Pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", - - "BotSharpTokenizer": { - "tokenizer": "TreebankTokenizer" - }, - - "BotSharpIntentClassifier": { - "classifer": "NaiveBayesClassifier" - }, - - "BotSharpTagger": { - "tagger": "NGramTagger" - }, - - "BotSharpCRFNer": { - "template": "|App_Data|CRFLite/template.en" - }, - - "WitAiEntityRecognizer": { - "url": "https://api.wit.ai", - "resource": "message", - "serverAccessToken": "SERVER_ACCESS_TOKEN", - "version": "20180811" - } + "agentStorage": "AgentStorageInRedis" } } diff --git a/BotSharp.WebHost/Settings/BotSharpAi.json b/BotSharp.WebHost/Settings/BotSharpAi.json deleted file mode 100644 index 705829b0..00000000 --- a/BotSharp.WebHost/Settings/BotSharpAi.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "BotSharpAi": { - "Lang": "en", - - "Provider": "BotSharpProvider", - "BotSharpProvider": { - }, - - "Pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", - - "BotSharpTokenizer": { - "tokenizer": "TreebankTokenizer" - }, - - "BotSharpIntentClassifier": { - "classifer": "SVMClassifier" - }, - - "BotSharpTagger": { - "tagger": "NGramTagger" - }, - - "BotSharpCRFNer": { - "template": "|App_Data|CRFLite/template.en" - }, - - "WitAiEntityRecognizer": { - "url": "https://api.wit.ai", - "resource": "message", - "serverAccessToken": "SERVER_ACCESS_TOKEN", - "version": "20180811" - } - } -} diff --git a/BotSharp.WebHost/Settings/BotSharpNLU.json b/BotSharp.WebHost/Settings/BotSharpNLU.json new file mode 100644 index 00000000..58e79d4d --- /dev/null +++ b/BotSharp.WebHost/Settings/BotSharpNLU.json @@ -0,0 +1,35 @@ +{ + "botSharpNLU": { + "lang": "en", + + "provider": "BotSharpProvider", + + "botSharpProvider": { + }, + + "pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", + + "botSharpTokenizer": { + "tokenizer": "TreebankTokenizer" + }, + + "botSharpIntentClassifier": { + "classifer": "NaiveBayesClassifier" + }, + + "botSharpTagger": { + "tagger": "NGramTagger" + }, + + "botSharpCRFNer": { + "template": "|App_Data|CRFLite/template.en" + }, + + "witAiEntityRecognizer": { + "url": "https://api.wit.ai", + "resource": "message", + "serverAccessToken": "SERVER_ACCESS_TOKEN", + "version": "20180811" + } + } +} diff --git a/BotSharp.WebHost/Settings/DialogflowAi.json b/BotSharp.WebHost/Settings/DialogflowAi.json index a4e73850..31f219e5 100644 --- a/BotSharp.WebHost/Settings/DialogflowAi.json +++ b/BotSharp.WebHost/Settings/DialogflowAi.json @@ -1,36 +1,7 @@ { - "DialogflowAi": { - "Lang": "en", + "dialogflowAi": { + "botEngine": "BotSharpNLU", - "AgentStorage": "AgentStorageInRedis", - - "Provider": "BotSharpProvider", - "BotSharpProvider": { - }, - - "Pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", - - "BotSharpTokenizer": { - "tokenizer": "TreebankTokenizer" - }, - - "BotSharpIntentClassifier": { - "classifer": "NaiveBayesClassifier" - }, - - "BotSharpTagger": { - "tagger": "NGramTagger" - }, - - "BotSharpCRFNer": { - "template": "|App_Data|CRFLite/template.en" - }, - - "WitAiEntityRecognizer": { - "url": "https://api.wit.ai", - "resource": "message", - "serverAccessToken": "SERVER_ACCESS_TOKEN", - "version": "20180811" - } + "agentStorage": "AgentStorageInRedis" } } diff --git a/BotSharp.WebHost/Settings/app.json b/BotSharp.WebHost/Settings/app.json index e8c72f86..4c647dff 100644 --- a/BotSharp.WebHost/Settings/app.json +++ b/BotSharp.WebHost/Settings/app.json @@ -1,9 +1,11 @@ { - "Assemblies": "BotSharp.Core", - "BotEngine": "BotSharpAi", - "Version": "0.1.0", + "assemblies": "BotSharp.Core", - "MachineLearning": { + "platform": "DialogflowAi", + + "version": "0.1.0", + + "machineLearning": { "dataDir": "D:\\Projects\\BotSharp\\Data" } } diff --git a/BotSharp.WebHost/Startup.cs b/BotSharp.WebHost/Startup.cs index 6e81a911..073a138c 100644 --- a/BotSharp.WebHost/Startup.cs +++ b/BotSharp.WebHost/Startup.cs @@ -1,8 +1,5 @@ -using BotSharp.Core.Engines; -using BotSharp.Platform.Abstraction; -using DotNetToolkit; +using Colorful; using DotNetToolkit.JwtHelper; -using EntityFrameworkCore.BootKit; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -12,8 +9,10 @@ using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.Swagger; using System; using System.Collections.Generic; +using System.Drawing; using System.IO; using System.Linq; +using Console = Colorful.Console; namespace BotSharp.WebHost { @@ -63,17 +62,10 @@ namespace BotSharp.WebHost }); // register platform dependency - services.AddTransient((provider) => + /*services.AddTransient((provider) => { - var assemblies = (String[])AppDomain.CurrentDomain.GetData("Assemblies"); - var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); - var implements = TypeHelper.GetClassesWithInterface(assemblies); - string platform = config.GetValue("BotPlatform"); - var implement = implements.FirstOrDefault(x => x.Name.Split('.').Last() == platform); - var instance = (IBotEngine)Activator.CreateInstance(implement); - return instance; - }); + });*/ } public void Configure(IApplicationBuilder app, IHostingEnvironment env) @@ -100,7 +92,9 @@ namespace BotSharp.WebHost c.DocumentTitle = info.Title; c.InjectStylesheet(Configuration.GetValue("Swagger:Stylesheet")); - Console.WriteLine($"Current Mode: {info.Title}"); + Console.WriteLine($"{info.Title} {info.Version} {info.License.Name}", Color.Gray); + Console.WriteLine($"{info.Description}", Color.Gray); + Console.WriteLine($"{info.Contact.Name}", Color.Gray); }); app.Use(async (context, next) => @@ -129,6 +123,16 @@ namespace BotSharp.WebHost loader.Env = env; loader.Config = Configuration; loader.Load();*/ + + var platform = Configuration.GetValue("Platform"); + var engine = Configuration.GetValue($"{platform}:BotEngine"); + Formatter[] settings = new Formatter[] + { + new Formatter(platform, Color.Yellow), + new Formatter(engine, Color.Yellow), + }; + + Console.WriteLineFormatted("Platform Emulator: {0} powered by {1} NLU engine.", Color.White, settings); } } } \ No newline at end of file diff --git a/Platform.Articulate/ArticulateAi.cs b/Platform.Articulate/ArticulateAi.cs index c20dcfce..b0eaa3d4 100644 --- a/Platform.Articulate/ArticulateAi.cs +++ b/Platform.Articulate/ArticulateAi.cs @@ -5,6 +5,7 @@ using BotSharp.Platform.Abstraction; using BotSharp.Platform.Models; using BotSharp.Platform.Models.AiRequest; using BotSharp.Platform.Models.AiResponse; +using BotSharp.Platform.Models.MachineLearning; using DotNetToolkit; using Platform.Articulate.Models; using System; @@ -133,7 +134,7 @@ namespace Platform.Articulate return base.SaveAgent(agent); } - public async Task Train(TAgent agent, TrainingCorpus corpus) + public async Task Train(TAgent agent, TrainingCorpus corpus) { string agentDir = Path.Combine(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "Projects", agent.Id); var model = "model_" + DateTime.UtcNow.ToString("yyyyMMdd"); @@ -149,7 +150,7 @@ namespace Platform.Articulate var info = await trainer.Train(agent, trainOptions); - return true; + return info; } public AiResponse TextRequest(AiRequest request)