GoogleCloudPlatform / dialogflow-integrations

Dialogflow integrations with multiple platforms including KIK, Skype, Spark, Twlio, Twitter and Viber
https://cloud.google.com/dialogflow/
Apache License 2.0
256 stars 503 forks source link

Passing contexts #2

Open reyerm opened 4 years ago

reyerm commented 4 years ago

There seems no way to pass contexts via this library to the actual detectIntent call. Value in this is if you want to maintain context over a long period of time (where Dialogflow would timeout).

Could the constructor and related function definitions not be changed to include this along lines of:

//add additional input variable below constructRequest(text, sessionPath, payload, prevContexts) { return { session: sessionPath, queryInput: { text: { text: text, languageCode: 'en' } }, queryParams: { payload: payload, // Add context to queryParams contexts: prevContexts } }; }

tyhu-google commented 4 years ago

reyerm, thanks for opening the issue. Dialogflow team will work on it for the request. Will update once the feature is ready.