[bixby] My Bixby capsule works fine if the user selects the time on-screen, but not if they try to select it by voice. I followed the training offered for "duration" in this example, but it doesn't seem to apply enter link description here for a "time"
structure (BedTime) { description (DESCRIPTION) role-of (time.Time) }
action (PrepareUserData) { description ("Prepare user data") type (Search) collect { // Keep this in place to retrieve any previously stored UserData computed-input (previousUserData) { type (UserData) min (Required) max (One) compute { intent { goal: GetUserData } } }
input (username) {
type (UserName)
min (Required) max (One)
}
input (wakeuptime) {
type (WakeupTime)
min (Required) max (One)
}
input (bedtime) {
type (BedTime)
min (Required) max (One)
}
input (message) {
type (Message)
min (Required) max (One)
}
}
output (UserData)
}
This training is "not learned" and when I invoke the utterance, it keeps asking me again
[![Wakeup training
[]4][5]
[5]: https://i.sstatic.net/YQvlg.jpgenter code here
Without actual capsule code, I can only speculate.
First, the concept should be viv.time.DateTimeExpression to better work with natural language such as "9PM tonight". You can read more about viv.time.DateTimeExpression here.
Second, the utterance "bedtime" is not an expected NL input for time. It should be more specific such as "9PM" or "8AM this Wednesday", or "8PM tomorrow".
Third topic is more like a heads-up. If use utterance such as "9PM Wednesday" for viv.time.DateTimeExpression, you may get more than 1 return value. It is confusing but understandable since it could be the Wednesday already passed or the coming Wednesday. So developer should take this into consideration, and handle such case in modeling or in JS.
I've spent sometime to do a sample capsule. It is not difficult to do except the following two catches:
Please see the attached screenshot. For a complete capsule you can test, you can download it.