2

I'm having an issue where when Dialogflow resolves @sys.date-time parameters for my intent with text something like '5am', they come back as tomorrow when they should be today.

(Today as of now is 2019-04-08, not 2019-04-09 as resolved)

{
"responseId":"48bcf62d-dc2d-4f3c-befb-af8565fe01cb",
"queryResult":
   {
      "queryText":"today at 5a.m.",
      "speechRecognitionConfidence":0.97964007,
      "parameters": {
           "duration":"",
           "date":"2019-04-09T05:00:00+02:00" 
       },
...

"outputContexts":[
{
 ...
 "name":"projects/xxxxx/agent/sessions/xxxxxx/contexts/xxxx",
 "parameters":{
   "duration":"",
   "date":"2019-04-09T05:00:00+02:00",
   "date.original":"5 a.m.",
   "duration.original":""
   ...
}},

I do also have a @sys.any in this request my suspicion is that may cause an issue. (I would rather it be a user defined entity but matching isn't reliable enough in ambiguous contexts so I have to do it myself).

Does anyone have experience with this and know any gotcha's here that I might be falling into? I would have thought that '5am' without any other modifiers should resolve to 5am today.

cdharris
  • 61
  • 5
  • is your time zone correct? i.e `02:00 europe`? – sid8491 Apr 08 '19 at 11:18
  • that's the correct timezone I'm in yeah – cdharris Apr 08 '19 at 11:29
  • 1
    At the time you asked this, had 5am already passed? Can you [update the question](https://stackoverflow.com/posts/55571956/edit) to show a screen shot of the intent, showing all the training phrases you're using? – Prisoner Apr 08 '19 at 12:03
  • Thanks @Prisoner, I can't share the intents right now, but Yes, 5am had already passed. You lead me down an insightful path, infact, since I only want to deal with times in the past I could just validate myself in fulfilment, correcting any futures days to Today. – cdharris Apr 08 '19 at 12:35

1 Answers1

3

As following the reasoning by @Prisoner in the comments, I thinking Dialogflow's assumption is fair. That when a time is heard without a date, it appears to presume it's in the future?

To solve this in my application, as I know dates are always in the past, I just fix a future date time to today's date with that time in my server side fulfilment.

cdharris
  • 61
  • 5