From 50b3a3c7abc8d64ee7d728e4325a6154ba18fc1b Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Tue, 2 Oct 2018 14:49:37 -0500 Subject: [PATCH] start working with dialogflow. --- BotSharp.NLP/BotSharp.NLP.csproj | 12 ++- BotSharp.WebHost/BotSharp.WebHost.csproj | 1 + BotSharp.sln | 84 +++---------------- .../Platform.Articulate.csproj | 21 ++++- .../Controllers}/EntitiesController.cs | 3 +- .../Controllers}/IntentsController.cs | 2 +- .../Controllers}/QueryController.cs | 3 +- .../Controllers}/TrainController.cs | 3 +- Platform.Dialogflow/DialogflowAi.cs | 35 ++++++++ Platform.Dialogflow/Models/AgentModel.cs | 38 +++++++++ Platform.Dialogflow/Models/EntityModel.cs | 19 +++++ .../Platform.Dialogflow.csproj | 32 ++++++- .../DialogflowAllEntityViewModel.cs | 2 +- .../ViewModels}/QueryModel.cs | 2 +- README.rst | 1 + 15 files changed, 168 insertions(+), 90 deletions(-) rename {BotSharp.RestApi/Dialogflow => Platform.Dialogflow/Controllers}/EntitiesController.cs (88%) rename {BotSharp.RestApi/Dialogflow => Platform.Dialogflow/Controllers}/IntentsController.cs (97%) rename {BotSharp.RestApi/Dialogflow => Platform.Dialogflow/Controllers}/QueryController.cs (97%) rename {BotSharp.RestApi/Dialogflow => Platform.Dialogflow/Controllers}/TrainController.cs (96%) create mode 100644 Platform.Dialogflow/DialogflowAi.cs create mode 100644 Platform.Dialogflow/Models/AgentModel.cs create mode 100644 Platform.Dialogflow/Models/EntityModel.cs rename {BotSharp.RestApi/Dialogflow => Platform.Dialogflow/ViewModels}/DialogflowAllEntityViewModel.cs (87%) rename {BotSharp.RestApi/Dialogflow => Platform.Dialogflow/ViewModels}/QueryModel.cs (97%) diff --git a/BotSharp.NLP/BotSharp.NLP.csproj b/BotSharp.NLP/BotSharp.NLP.csproj index 47743c11b..a2e8be070 100644 --- a/BotSharp.NLP/BotSharp.NLP.csproj +++ b/BotSharp.NLP/BotSharp.NLP.csproj @@ -26,22 +26,20 @@ Naive Bayes Classifier Debug;Release;RASA NLU;DIALOGFLOW;RASA;ARTICULATE - - DEBUG;TRACE - - - RASA;DEBUG;TRACE + TRACE;DEBUG bin\RASA + false - DEBUG;TRACE;DIALOGFLOW;NETSTANDARD;NETSTANDARD2_0 + TRACE;DEBUG false - TRACE;ARTICULATE + TRACE;DEBUG + false diff --git a/BotSharp.WebHost/BotSharp.WebHost.csproj b/BotSharp.WebHost/BotSharp.WebHost.csproj index 86925ced7..ce494485e 100644 --- a/BotSharp.WebHost/BotSharp.WebHost.csproj +++ b/BotSharp.WebHost/BotSharp.WebHost.csproj @@ -66,6 +66,7 @@ + diff --git a/BotSharp.sln b/BotSharp.sln index 4bd1172fe..6118b2c49 100644 --- a/BotSharp.sln +++ b/BotSharp.sln @@ -12,6 +12,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.WebHost", "BotShar {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22} = {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22} {75B02A7C-EDB3-4082-9C1F-471773E760C3} = {75B02A7C-EDB3-4082-9C1F-471773E760C3} {184F8B93-68C2-4849-9625-4023C4360990} = {184F8B93-68C2-4849-9625-4023C4360990} + {62F08F9F-16C2-4754-90B0-B604DC18AE23} = {62F08F9F-16C2-4754-90B0-B604DC18AE23} + {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72} = {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72} EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.NLP", "BotSharp.NLP\BotSharp.NLP.csproj", "{C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}" @@ -32,14 +34,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Models", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Platform.Articulate", "Platform.Articulate\Platform.Articulate.csproj", "{2B279A6C-C829-4D29-9C1C-809C8A8E36B2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Platform.RasaTalk", "Platform.RasaTalk\Platform.RasaTalk.csproj", "{4D8203E8-0A68-42C9-AA21-9A0514E1008A}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Platform.Dialogflow", "Platform.Dialogflow\Platform.Dialogflow.csproj", "{25503190-0B4B-4ECA-8C0C-D12A53A09583}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Platform.RasaUI", "Platform.RasaUI\Platform.RasaUI.csproj", "{FD087443-4A45-4796-893C-6EEB2D5029D5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Platform.Botpress", "Platform.Botpress\Platform.Botpress.csproj", "{D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution ARTICULATE|Any CPU = ARTICULATE|Any CPU @@ -274,8 +270,8 @@ Global {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Release|Any CPU.Build.0 = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Release|x64.ActiveCfg = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Release|x64.Build.0 = Release|Any CPU - {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.ARTICULATE|Any CPU.ActiveCfg = Debug|Any CPU - {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.ARTICULATE|Any CPU.Build.0 = Debug|Any CPU + {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU + {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.ARTICULATE|Any CPU.Build.0 = ARTICULATE|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.ARTICULATE|x64.ActiveCfg = Debug|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.ARTICULATE|x64.Build.0 = Debug|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -286,36 +282,16 @@ Global {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.RASA|Any CPU.Build.0 = Release|Any CPU + {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.RASA|Any CPU.ActiveCfg = RASA|Any CPU + {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.RASA|Any CPU.Build.0 = RASA|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.RASA|x64.ActiveCfg = Release|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.RASA|x64.Build.0 = Release|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.Release|Any CPU.Build.0 = Release|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.Release|x64.ActiveCfg = Release|Any CPU {2B279A6C-C829-4D29-9C1C-809C8A8E36B2}.Release|x64.Build.0 = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.ARTICULATE|Any CPU.ActiveCfg = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.ARTICULATE|Any CPU.Build.0 = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.ARTICULATE|x64.ActiveCfg = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.ARTICULATE|x64.Build.0 = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Debug|x64.ActiveCfg = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Debug|x64.Build.0 = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.DIALOGFLOW|Any CPU.ActiveCfg = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.RASA|Any CPU.Build.0 = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.RASA|x64.ActiveCfg = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.RASA|x64.Build.0 = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Release|Any CPU.Build.0 = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Release|x64.ActiveCfg = Release|Any CPU - {4D8203E8-0A68-42C9-AA21-9A0514E1008A}.Release|x64.Build.0 = Release|Any CPU - {25503190-0B4B-4ECA-8C0C-D12A53A09583}.ARTICULATE|Any CPU.ActiveCfg = Debug|Any CPU - {25503190-0B4B-4ECA-8C0C-D12A53A09583}.ARTICULATE|Any CPU.Build.0 = Debug|Any CPU + {25503190-0B4B-4ECA-8C0C-D12A53A09583}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU + {25503190-0B4B-4ECA-8C0C-D12A53A09583}.ARTICULATE|Any CPU.Build.0 = ARTICULATE|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.ARTICULATE|x64.ActiveCfg = Debug|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.ARTICULATE|x64.Build.0 = Debug|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -326,54 +302,14 @@ Global {25503190-0B4B-4ECA-8C0C-D12A53A09583}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {25503190-0B4B-4ECA-8C0C-D12A53A09583}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {25503190-0B4B-4ECA-8C0C-D12A53A09583}.RASA|Any CPU.Build.0 = Release|Any CPU + {25503190-0B4B-4ECA-8C0C-D12A53A09583}.RASA|Any CPU.ActiveCfg = RASA|Any CPU + {25503190-0B4B-4ECA-8C0C-D12A53A09583}.RASA|Any CPU.Build.0 = RASA|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.RASA|x64.ActiveCfg = Release|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.RASA|x64.Build.0 = Release|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.Release|Any CPU.ActiveCfg = Release|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.Release|Any CPU.Build.0 = Release|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.Release|x64.ActiveCfg = Release|Any CPU {25503190-0B4B-4ECA-8C0C-D12A53A09583}.Release|x64.Build.0 = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.ARTICULATE|Any CPU.ActiveCfg = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.ARTICULATE|Any CPU.Build.0 = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.ARTICULATE|x64.ActiveCfg = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.ARTICULATE|x64.Build.0 = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Debug|x64.ActiveCfg = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Debug|x64.Build.0 = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.DIALOGFLOW|Any CPU.ActiveCfg = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.RASA|Any CPU.Build.0 = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.RASA|x64.ActiveCfg = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.RASA|x64.Build.0 = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Release|Any CPU.Build.0 = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Release|x64.ActiveCfg = Release|Any CPU - {FD087443-4A45-4796-893C-6EEB2D5029D5}.Release|x64.Build.0 = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.ARTICULATE|Any CPU.ActiveCfg = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.ARTICULATE|Any CPU.Build.0 = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.ARTICULATE|x64.ActiveCfg = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.ARTICULATE|x64.Build.0 = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Debug|x64.ActiveCfg = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Debug|x64.Build.0 = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.DIALOGFLOW|Any CPU.ActiveCfg = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.RASA|Any CPU.Build.0 = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.RASA|x64.ActiveCfg = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.RASA|x64.Build.0 = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Release|Any CPU.Build.0 = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Release|x64.ActiveCfg = Release|Any CPU - {D796FD0C-D161-41D1-8D3C-5B9B39FB3C28}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Platform.Articulate/Platform.Articulate.csproj b/Platform.Articulate/Platform.Articulate.csproj index 411a0c54f..9bab319ab 100644 --- a/Platform.Articulate/Platform.Articulate.csproj +++ b/Platform.Articulate/Platform.Articulate.csproj @@ -1,11 +1,28 @@ - + netstandard2.0 + Debug;Release;RASA;ARTICULATE + + TRACE;DEBUG;RASA + false + + + + TRACE;DEBUG + false + + - TRACE;DEBUG;ARTICULATE + bin\DIALOGFLOW + TRACE;DEBUG;DIALOGFLOW + + + + false + TRACE;DEBUG diff --git a/BotSharp.RestApi/Dialogflow/EntitiesController.cs b/Platform.Dialogflow/Controllers/EntitiesController.cs similarity index 88% rename from BotSharp.RestApi/Dialogflow/EntitiesController.cs rename to Platform.Dialogflow/Controllers/EntitiesController.cs index 3c276fba0..206e49fec 100644 --- a/BotSharp.RestApi/Dialogflow/EntitiesController.cs +++ b/Platform.Dialogflow/Controllers/EntitiesController.cs @@ -1,10 +1,11 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Platform.Dialogflow.ViewModels; using System; using System.Collections.Generic; using System.Text; -namespace BotSharp.RestApi.Dialogflow +namespace Platform.Dialogflow.Controllers { #if DIALOGFLOW /// diff --git a/BotSharp.RestApi/Dialogflow/IntentsController.cs b/Platform.Dialogflow/Controllers/IntentsController.cs similarity index 97% rename from BotSharp.RestApi/Dialogflow/IntentsController.cs rename to Platform.Dialogflow/Controllers/IntentsController.cs index 3c053825e..2525c33c1 100644 --- a/BotSharp.RestApi/Dialogflow/IntentsController.cs +++ b/Platform.Dialogflow/Controllers/IntentsController.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Text; -namespace BotSharp.RestApi.Dialogflow +namespace Platform.Dialogflow.Controllers { #if DIALOGFLOW /// diff --git a/BotSharp.RestApi/Dialogflow/QueryController.cs b/Platform.Dialogflow/Controllers/QueryController.cs similarity index 97% rename from BotSharp.RestApi/Dialogflow/QueryController.cs rename to Platform.Dialogflow/Controllers/QueryController.cs index 16cfecc1f..0ca2df030 100644 --- a/BotSharp.RestApi/Dialogflow/QueryController.cs +++ b/Platform.Dialogflow/Controllers/QueryController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; +using Platform.Dialogflow.ViewModels; using System; using System.Collections.Generic; using System.IO; @@ -11,7 +12,7 @@ using System.Security.Claims; using System.Text; -namespace BotSharp.RestApi.Dialogflow +namespace Platform.Dialogflow.Controllers { #if DIALOGFLOW /// diff --git a/BotSharp.RestApi/Dialogflow/TrainController.cs b/Platform.Dialogflow/Controllers/TrainController.cs similarity index 96% rename from BotSharp.RestApi/Dialogflow/TrainController.cs rename to Platform.Dialogflow/Controllers/TrainController.cs index ff0f68aef..6dc09cdb7 100644 --- a/BotSharp.RestApi/Dialogflow/TrainController.cs +++ b/Platform.Dialogflow/Controllers/TrainController.cs @@ -1,6 +1,7 @@ using BotSharp.Core.Agents; using BotSharp.Core.Engines; using BotSharp.Core.Engines.Rasa; +using BotSharp.Platform.Models; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -13,7 +14,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; -namespace BotSharp.RestApi.Rasa +namespace Platform.Dialogflow.Controllers { #if DIALOGFLOW /// diff --git a/Platform.Dialogflow/DialogflowAi.cs b/Platform.Dialogflow/DialogflowAi.cs new file mode 100644 index 000000000..e8d46acac --- /dev/null +++ b/Platform.Dialogflow/DialogflowAi.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using BotSharp.Core; +using BotSharp.Core.Engines; +using BotSharp.Platform.Abstraction; +using BotSharp.Platform.Models; +using BotSharp.Platform.Models.AiRequest; +using BotSharp.Platform.Models.AiResponse; +using Platform.Dialogflow.Models; + +namespace Platform.Dialogflow +{ + public class DialogflowAi : + PlatformBuilderBase, + IPlatformBuilder + where TAgent : AgentModel + { + public TrainingCorpus ExtractorCorpus(TAgent agent) + { + throw new NotImplementedException(); + } + + public AiResponse TextRequest(AiRequest request) + { + throw new NotImplementedException(); + } + + public Task Train(TAgent agent, TrainingCorpus corpus) + { + throw new NotImplementedException(); + } + } +} diff --git a/Platform.Dialogflow/Models/AgentModel.cs b/Platform.Dialogflow/Models/AgentModel.cs new file mode 100644 index 000000000..5b5e2a18f --- /dev/null +++ b/Platform.Dialogflow/Models/AgentModel.cs @@ -0,0 +1,38 @@ +using BotSharp.Platform.Models; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Platform.Dialogflow.Models +{ + public class AgentModel : AgentBase + { + public AgentModel() + { + Entities = new List(); + } + + public string Status { get; set; } + + public string Timezone { get; set; } + + public string AgentName { get; set; } + + public bool UseWebhook { get; set; } + + public bool UsePostFormat { get; set; } + + public bool ExtraTrainingData { get; set; } + + public List FallbackResponses { get; set; } + + public bool EnableModelsPerDomain { get; set; } + + public decimal DomainClassifierThreshold { get; set; } + + public List Entities { get; set; } + + public DateTime LastTraining { get; set; } + } +} diff --git a/Platform.Dialogflow/Models/EntityModel.cs b/Platform.Dialogflow/Models/EntityModel.cs new file mode 100644 index 000000000..aed1538b2 --- /dev/null +++ b/Platform.Dialogflow/Models/EntityModel.cs @@ -0,0 +1,19 @@ +using BotSharp.Platform.Abstraction; +using BotSharp.Platform.Models; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Platform.Dialogflow.Models +{ + public class EntityModel : EntityBase + { + public string Agent { get; set; } + + public string EntityName { get; set; } + + public string Type { get; set; } + + public string UiColor { get; set; } + } +} diff --git a/Platform.Dialogflow/Platform.Dialogflow.csproj b/Platform.Dialogflow/Platform.Dialogflow.csproj index 9f5c4f4ab..4001aeaa4 100644 --- a/Platform.Dialogflow/Platform.Dialogflow.csproj +++ b/Platform.Dialogflow/Platform.Dialogflow.csproj @@ -1,7 +1,37 @@ - + netstandard2.0 + Debug;Release;RASA;ARTICULATE + + TRACE;DEBUG + bin\RASA + false + + + + DEBUG;TRACE;DIALOGFLOW;NETSTANDARD;NETSTANDARD2_0 + false + + + + TRACE;DEBUG + false + + + + TRACE;DEBUG;DIALOGFLOW + bin\DIALOGFLOW + + + + + + + + + + diff --git a/BotSharp.RestApi/Dialogflow/DialogflowAllEntityViewModel.cs b/Platform.Dialogflow/ViewModels/DialogflowAllEntityViewModel.cs similarity index 87% rename from BotSharp.RestApi/Dialogflow/DialogflowAllEntityViewModel.cs rename to Platform.Dialogflow/ViewModels/DialogflowAllEntityViewModel.cs index bd339e35d..e66f3b42b 100644 --- a/BotSharp.RestApi/Dialogflow/DialogflowAllEntityViewModel.cs +++ b/Platform.Dialogflow/ViewModels/DialogflowAllEntityViewModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace BotSharp.RestApi.Dialogflow +namespace Platform.Dialogflow.ViewModels { public class DialogflowAllEntityViewModel { diff --git a/BotSharp.RestApi/Dialogflow/QueryModel.cs b/Platform.Dialogflow/ViewModels/QueryModel.cs similarity index 97% rename from BotSharp.RestApi/Dialogflow/QueryModel.cs rename to Platform.Dialogflow/ViewModels/QueryModel.cs index 643b1d05d..9d4f78919 100644 --- a/BotSharp.RestApi/Dialogflow/QueryModel.cs +++ b/Platform.Dialogflow/ViewModels/QueryModel.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.Text; -namespace BotSharp.RestApi.Dialogflow +namespace Platform.Dialogflow.ViewModels { public class QueryModel { diff --git a/README.rst b/README.rst index c2a626eec..5f5bc28ed 100644 --- a/README.rst +++ b/README.rst @@ -15,6 +15,7 @@ The Open Source AI Bot Platform Builder :target: `botsharpnuget`_ :alt: NuGet + .. raw:: html