小编Mar*_*lla的帖子

Dialogflow - Google Assistant:显示消息后 setFollowupEvent

这是我的用例:在我的实现中的某个地方,在处理意图 A 时,我想使用 调用意图setFollowupEventB。就像是:

function intentA_Handler(){
    ....
    agent.add('This is the response when calling Intent A');
    agent.setFollowupEvent('call_intent_B_event');
}

function intentB_Handler(){
    agent.add('I am in intent B now.');
    ....
}
Run Code Online (Sandbox Code Playgroud)

我期待什么:

  1. 助手显示并说出字符串这是调用 Intent A 时的响应
  2. 然后打电话并显示并说出我现在处于意图 B 中的agent.setFollowupEvent('call_intent_B_event');字符串。

会发生什么:

助手立即向我显示并说出我现在在意图 B 中的字符串,并省略第一个字符串这是调用意图 A 时的响应

已经尝试过:

function intentA_Handler(){
    ....
    new Promise((resolve, reject) => {
        agent.add('This is the response when calling Intent A');
        resolve();
    });

    agent.setFollowupEvent('call_intent_B_event');
}
Run Code Online (Sandbox Code Playgroud)

但结果还是一样。知道如何实现我的目标吗?

node.js actions-on-google dialogflow-es

6
推荐指数
1
解决办法
2508
查看次数

标签 统计

actions-on-google ×1

dialogflow-es ×1

node.js ×1