这是我的用例:在我的实现中的某个地方,在处理意图 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)
我期待什么:
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)
但结果还是一样。知道如何实现我的目标吗?