diff --git a/BotSharp.Core/Agents/Agent.cs b/BotSharp.Core/Agents/Agent.cs index 6a6429c1..79617723 100644 --- a/BotSharp.Core/Agents/Agent.cs +++ b/BotSharp.Core/Agents/Agent.cs @@ -26,7 +26,7 @@ namespace BotSharp.Core.Agents public Boolean Published { get; set; } - [MaxLength(3)] + [MaxLength(5)] public String Language { get; set; } /// diff --git a/BotSharp.Core/Engines/AgentImporterInDialogflow.cs b/BotSharp.Core/Engines/AgentImporterInDialogflow.cs index 19f60ae3..ff8301d0 100644 --- a/BotSharp.Core/Engines/AgentImporterInDialogflow.cs +++ b/BotSharp.Core/Engines/AgentImporterInDialogflow.cs @@ -30,8 +30,10 @@ namespace BotSharp.Core.Engines public void LoadEntities(Agent agent, string agentDir) { agent.Entities = new List(); + string entityDir = $"{agentDir}{Path.DirectorySeparatorChar}Dialogflow{Path.DirectorySeparatorChar}{agent.Name}{Path.DirectorySeparatorChar}entities"; + if (!Directory.Exists(entityDir)) return; - Directory.EnumerateFiles($"{agentDir}{Path.DirectorySeparatorChar}Dialogflow{Path.DirectorySeparatorChar}{agent.Name}{Path.DirectorySeparatorChar}entities") + Directory.EnumerateFiles(entityDir) .ToList() .ForEach(fileName => { @@ -62,8 +64,10 @@ namespace BotSharp.Core.Engines public void LoadIntents(Agent agent, string agentDir) { agent.Intents = new List(); + string intentDir = $"{agentDir}{Path.DirectorySeparatorChar}Dialogflow{Path.DirectorySeparatorChar}{agent.Name}{Path.DirectorySeparatorChar}intents"; + if (!Directory.Exists(intentDir)) return; - Directory.EnumerateFiles($"{agentDir}{Path.DirectorySeparatorChar}Dialogflow{Path.DirectorySeparatorChar}{agent.Name}{Path.DirectorySeparatorChar}intents") + Directory.EnumerateFiles(intentDir) .ToList() .ForEach(fileName => { diff --git a/BotSharp.Core/Intents/IntentResponseMessage.cs b/BotSharp.Core/Intents/IntentResponseMessage.cs index 06b97dbf..98cde8d1 100644 --- a/BotSharp.Core/Intents/IntentResponseMessage.cs +++ b/BotSharp.Core/Intents/IntentResponseMessage.cs @@ -18,7 +18,7 @@ namespace BotSharp.Core.Intents public AIResponseMessageType Type { get; set; } [Required] - [MaxLength(3)] + [MaxLength(5)] public String Lang { get; set; } ///