change agent data table definition.

This commit is contained in:
Oceania2018 2018-05-21 08:28:19 -05:00
parent 2e91b54d6d
commit e1291ae214
3 changed files with 8 additions and 4 deletions

View file

@ -26,7 +26,7 @@ namespace BotSharp.Core.Agents
public Boolean Published { get; set; }
[MaxLength(3)]
[MaxLength(5)]
public String Language { get; set; }
/// <summary>

View file

@ -30,8 +30,10 @@ namespace BotSharp.Core.Engines
public void LoadEntities(Agent agent, string agentDir)
{
agent.Entities = new List<Entity>();
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<Intent>();
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 =>
{

View file

@ -18,7 +18,7 @@ namespace BotSharp.Core.Intents
public AIResponseMessageType Type { get; set; }
[Required]
[MaxLength(3)]
[MaxLength(5)]
public String Lang { get; set; }
/// <summary>