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

Support for other content types in Twilio integration #18

Open diamondobama opened 4 years ago

diamondobama commented 4 years ago

Twilio accepts location and media sharing from a platform like WhatsApp. When this content comes in, the body.Body parameter is left empty and additional parameters are added for these content types. Dialogflow however, can't process an empty body content, hence the request fails.

For this purpose, if location is shared, we should pass geoLocation in the body parameter; if it's any other media type, we get the type from MediaContentType0 and pass that.

Then, on Dialogflow side, we process this information by providing training data that matches e.g. geolocation, image/jpeg, audio/mp3, application/pdf...etc. And we read additional information through the fulfillment in req.originalDetectIntentRequest.payload e.g. req.originalDetectIntentRequest.payload.MediaUrl0.

tyhu-google commented 4 years ago

diamondobama, thanks for contributing to Dialogflow's repo.