I'm using the dialogflow Node SDK to send textRequests and eventRequests to dialog flow. The fulfillment webhook shows that the context is not preserved though the sessionId is the same. Working with the same dialogflow agent from actions-on-google assistant, the context is preserved. so the only difference is that i'm using the Node SDK to send the text.
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);
the second request does not trigger INTENT_2, but the default fallback intent, unless I remove the input context from INTENT_2 in dialogflow and then it's triggered
Might you be using resetContexts
by mistake? That would explain it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With