我正在使用dialogflow Node SDK向dialog flow发送textRequests和eventRequests。尽管sessionId相同,但fulfillment webhook显示上下文没有被保留。在使用actions-on-google助手从同一的dialogflow代理进行操作时,上下文是被保留的。因此,唯一的区别是我正在使用Node SDK来发送文本。
第二个请求不会触发INTENT_2,而是会触发默认的回退意图,除非我在Dialogflow中删除INTENT_2的输入上下文,然后它才会被触发。
this.app = apiai(CLIENT_ACCESS_TOKEN);
this.options = {
sessionId: 'abc',
originalRequest: {
data: {
user: 'temp_user'
},
conversation: {
"conversationId": "123456789"
}
}
};
const request = this.app.textRequest('This is captured by INTENT_1 that triggers
a webhook that sets context to MY_CONTEXT', options);
const request = this.app.textRequest('This should be captured by INTENT_2
that has an input context of MY_CONTEXT', options);
第二个请求不会触发INTENT_2,而是会触发默认的回退意图,除非我在Dialogflow中删除INTENT_2的输入上下文,然后它才会被触发。