Google cloud platform 后续意图未在intentMap.set-Dialogflow中触发处理程序方法

Google cloud platform 后续意图未在intentMap.set-Dialogflow中触发处理程序方法,google-cloud-platform,dialogflow-es,dialogflow-es-fulfillment,Google Cloud Platform,Dialogflow Es,Dialogflow Es Fulfillment,我有几个嵌套的后续意图,如下所示: 然后在实现函数的代码中,我有一个数字70触发了给定的选择,但其余的没有触发。为什么?我如何在后续计划中做到这一点 let intentMap = new Map(); intentMap.set('Default Welcome Intent', welcome); intentMap.set('Default Fallback Intent', fallback); //Intent - 70 intentMap.set('0068 - In

我有几个嵌套的后续意图,如下所示:

然后在实现函数的代码中,我有一个数字70触发了给定的选择,但其余的没有触发。为什么?我如何在后续计划中做到这一点

let intentMap = new Map();
  intentMap.set('Default Welcome Intent', welcome);
  intentMap.set('Default Fallback Intent', fallback);
  //Intent - 70
  intentMap.set('0068 - Intents - 70', giveChoice);
  intentMap.set('0068 - Intents - 70 - no', giveFirstNextQuestion);
  intentMap.set('0068 - Intents - 70 - no - no', giveSecondNextQuestion);
  intentMap.set('0068 - Intents - 70 - no - no - no', giveThirdNextQuestion);
  // intentMap.set('your intent name here', googleAssistantHandler);
  agent.handleRequest(intentMap);

我设法重现了你的问题并解决了它。我将总结以下几点:

在“实现”部分中为您想要使用的所有意图和后续意图启用此意图的webhook调用

您创建要使用的函数,giveChoice,giveFirstNextQuestion,。。。应遵循以下结构:

请注意,在上述情况下,我只做了一次跟进。例如,如果执行第三个函数,则第二个函数必须具有getContext和setContext才能正常工作

最后一部分和你做的一模一样。就我而言:

  function givechoice(agent){
    agent.add(`Would you like this response to be recorded?`);
    agent.setContext({
      name: 'first-call',
      lifespan: 2,
    });
  }

  function afirmative(agent){
    agent.getContext('first-call');
    agent.add(`Thank you for accepting`);
  }
  let intentMap = new Map();
  intentMap.set('0068 - Intents - 70',givechoice);
  intentMap.set('0068 - Intents - 70 - yes',afirmative);
  agent.handleRequest(intentMap);