From 78fe7deb5f1073fec2ee01cf1d2041e0b12297d7 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 3 Oct 2018 14:22:51 -0500 Subject: [PATCH] dialogflow query controller --- BotSharp.Core/Engines/BotPredictor.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BotSharp.Core/Engines/BotPredictor.cs b/BotSharp.Core/Engines/BotPredictor.cs index da8b05ed..f4a29339 100644 --- a/BotSharp.Core/Engines/BotPredictor.cs +++ b/BotSharp.Core/Engines/BotPredictor.cs @@ -58,7 +58,7 @@ namespace BotSharp.Core.Engines // pipe process - var pipelines = provider.Configuration.GetValue($"Pipe") + var pipelines = config.GetValue($"{meta.BotEngine}:pipe") .Split(',') .Select(x => x.Trim()) .ToList(); @@ -66,9 +66,10 @@ namespace BotSharp.Core.Engines for(int pipeIdx = 0; pipeIdx < pipelines.Count; pipeIdx++) { var pipe = TypeHelper.GetInstance(pipelines[pipeIdx], assemblies) as INlpPredict; - pipe.Configuration = provider.Configuration.GetSection(pipelines[pipeIdx]); + pipe.Configuration = config.GetSection(meta.BotEngine).GetSection(pipelines[pipeIdx]); pipe.Settings = settings; - await pipe.Predict(agent, data, meta.Pipeline.FirstOrDefault(x => x.Name == pipelines[pipeIdx])); + var pipeModel = meta.Pipeline.FirstOrDefault(x => x.Name == pipelines[pipeIdx]); + await pipe.Predict(agent, data, pipeModel); } Console.WriteLine($"Prediction result:", Color.Green);