range |
{ “from” : <from-datetime>, “to” : <to-datetime> } |
To extract date-times only in the specified range. Either endpoint is optional.
Values can be a date, YYYY-MM-DD, or a DateTime, YYYY-MM-DDTHH:MM:SS (user’s timezone is assumed if none specified) or a keyword: today, tomorrow, yesterday, now. The dates are inclusive. |
Example |
JSON
{
"range": {
"from": "2020-01-01T00:00:00+05:30",
"to": "2020-10-01T00:00:00+05:30"
}
}
|
Entity Pattern – by default date time patterns
User Utterance “set alarm for 2019-02-03T10:00:00”
Extracted Value prompt for a value
User Utterance “show schedule for 2021-12-20T10:00:00”
Extracted Value prompt for a value
User Utterance “show schedule for 2020-02-03 T10:00:00”
Extracted Value “2020-02-03T10:00:00” |
preferredTimes |
{ “from” : <from-time>,
“to” : <to-time> } |
To set the preferred time which can be used to interpret times when they are ambiguous. These times would be applicable to all days of the week.
For example, “3” will become “3 pm” if the preferredTimes are 9 am to 6 pm.
If the time cannot be placed inside the range then it will pick am/pm based on which is closest. If there are two possibilities or equal distance then the “daylight/standard awake” hours will be used. The times should be ISO 8601 format, THH:MM |
{ “from” : [],
“to” : [] } |
This option is for setting preferred times different for different days of the week. The “from” and “to” keys can be arrays with 7 members representing the time for each day, from Sunday to Saturday. Each value should be in the in Thh:MM format or an empty string to indicate there is no preference. |
{ “favor” : <keyword> } |
The “favor” keyword can be used to set the preference in terms of “future”, “past”, “am”, or “pm”. |
Example |
JSON
"preferredTimes": {
"from": "T12:00:00",
"to": "T18:00:00"
}
|
Entity Pattern – by default date patterns
User Utterance “remind me at 3”
Extracted Value “T15:00:00” |
JSON
"preferredTimes": {
"from": [
"", "T09:00",
"T09:00", "T21:00",
"T21:00", "T07:00", ""
],
"to": [
"", "T18:00",
"T18:00", "T06:00",
"T06:00", "T16:00", ""
]
}
|
Entity Pattern – by default date patterns
User Utterance “remind me at 3”
Extracted Value “T15:00:00”, if the current day is Monday/Tuesday/Friday;
“T03:00:00”, if the current day is Wednesday/Thursday |
JSON
"preferredTimes": {
"favor": "pm"
}
|
Entity Pattern – by default date patterns
User Utterance “remind me at 3”
Extracted Value “T15:00:00” |
timeRangePossible |
true/false |
If true then the dialog will be looking for time range in the user input.
Influences how “10 to 4” is interpreted. By default, this will be “3:50” but if there is the possibility of a range then will be decoded as 2 times “10:00” and “16:00” |
Example |
JSON
{
"timeRangePossible": "true"
}
|
|
preferredDateFormat |
“yyyy-mm-dd” |
In case of ambiguity in date, it uses the preferred date format to resolve ambiguity.
Values can be:
- “yyyy-mm-dd”
- “yyyy-dd-mm”
- “ddmmyyyy”
- “mmddyyyy”
|
Example |
JSON
{
"preferredDateFormat": "mm-dd-yyyy"
}
|
User Utterance “03-04-2021”
Extracted Value “2021-03-04”
NOTE: This rule comes into the picture only when there is an ambiguity in the user utterance. If the user’s preference is already set as part of a previous conversation, then the user selected format would take precedence over the defined rule
For example, a per the previous use case, if the user had selected the preferred format to be “dd-mm-yyy” previously in the conversation then the date would be taken as “2021-04-03” |