I'm making an app on Dialogflow and need to extract date-time
info from user. So I specified a required parameter called "date-time" with @sys.date-time entity in my intent. However, when I tried to extract this parameter in my fulfillment code, I found that this parameter structure is not the same every time when I extract it. For example, when I type 12:30am
into the chatbot, the returned API json response contained this:
"parameters": {
"date-time": "2019-11-27T00:30:00-08:00",
"log": "5"
},
So I can directly read date-time
parameter value by parameters['date-time']
However, if I type "yesterday at 2pm" into chatbot, the returned parameter structure is this:
"parameters": {
"date-time": {
"date_time": "2019-11-25T14:00:00-08:00"
},
"log": "log"
},
See that the "date-time" parameter is wrapped inside an extra "date-time" object. This is really annoying because now i need to consider these two cases in my fulfillment code. Does anyone know why this happened? And is this a bug on my side? Thanks!