错误:与MS botframework调用session.endDialog()太多

我有一个这样的游戏来创build一个虚构的公用事业公司,并看着使用LUIS来解释我的回应,并传回信息。 我很高兴LUIS的一面。 如果我问“我的天然气合同什么时候开始”,我得到以下回复:

{ "query": "when did my gas contract start", "intents": [ { "intent": "StartDate", "score": 0.9994442 } ], "entities": [ { "entity": "gas", "type": "ProductType", "startIndex": 12, "endIndex": 14, "score": 0.998134553 } ] } 

所以一个“startdate”和一个实体“gas”的意图。

在我的app.js中,我有以下行:

 dialog.on('StartDate', [askProduct, answerQuestion('StartDate', prompts.answerStartDate)]); 

当我(我认为)做瀑布部分时,我得到标题中的错误。

我不确定这是否与我的generics瀑布答案,我无耻地从基础multiTurn的例子偷走了。 所以我的答案代码如下:

 function answerQuestion(field, answerTemplate) { return function (session, results) { // Check to see if we have a product. The user can cancel picking a product so IPromptResult.response // can be null. if (results.response) { // Save product for multi-turn case and compose answer var Product = session.dialogData.Product = results.response; var answer = { Product: Product.entity, value: data[Product.entity][field] }; session.send(answerTemplate, answer); } else { session.send(prompts.cancel); } }; } 

我的app.js中的数据是

 var data = { 'Gas': { StartDate: 'Mar 10, 2016', NextInvoiceDate: 'June 13, 2016', LastInvoiceDate: 'May 13, 2016', LastAmount: '£23.56', NextAmount: '£26.32', description: 'You gas bill is based around the units of gas you have used in the past billing period, plus a standing charge. You next bill is an extrapolation if your current usage data for the period, and also based on your usage history.', website: 'http://www.blah.com' }, 'Electricity': { StartDate: 'Mar 10, 2016', NextInvoiceDate: 'June 13, 2016', LastInvoiceDate: 'May 13, 2016', LastAmount: '£27.35', NextAmount: '£29.72', description: 'You electricity bill is based around the units of gas you have used in the past billing period, plus a standing charge. You next bill is an extrapolation if your current usage data for the period, and also based on your usage history.', website: 'http://www.blah.com' }, }; 

我的提示文件包含:

 answerStartDate: "Your %(Product) Product started on %(value).", 

有任何想法吗?