dialog:generate - datetime schema does not handle ambiguous time and date
Use this query to search for the most popular feature requests.
Is your feature request related to a problem? Please describe.
When prompting for date and time, sometimes the user input may be ambiguous. For example, the user may enter 2 o'clock. The resultant timex entity may looks like below
{ “timex”: [ "T02", "T14" ], “type”: “time” }
There are 2 entries in the timex because the user input is ambiguous.
Describe the solution you'd like A clear and concise description of what you want to happen. To disambigu·ate user inputs, the generated code should follow up with an additional question such as
Is AM or PM?
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
[enhancement]
@johnataylor Could you please take a look at this?
Could you be clear about the context? Specifically, what do you mean when you say "generated code?"
There is a package (in .NET and JavaScript) and a sample here: https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/40.timex-resolution
(and the corresponding in JavaScript)
This illustrates how, in code, you can apply constraints to the TIMEX expression to resolve it. You can also use the library to determine if the expression is "definite" and you can use that to ask a disambiguating question to the user. On receiving more user into the corresponding constraint can be applied. However, this is all code you would add to your application logic. The package (and the sample) are designed to help you write this code.
use this schema file
{ "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "properties": { "ReadingDate": { "type": "string", "format": "date" }, "ReadingTime": { "type": "string", "format": "time" } }, "required": [ "ReadingDate", "ReadingTime" ] }
use the instruction to generate, build and run the bot
when prompted for date enter today when prompted for time enter 2 o'clock
The time is ambiguous as 2 o'clock mean 2 AM or 2 PM I would expect the bot to follow up with another prompt
is it AM or PM?
But this is not happening as bf dialog:generate tool does not generate code for the last prompt. Given that this is a common scenario, can the tool generate the code for the prompt automatically?
This sounds like a great suggestion. @chrimc62 maybe you can comment.
It is great you are experimenting with generated dialogs and I would love to hear your scenario and get feedback. We continue to improve the templates and better support for date time is on the roadmap. If you have built some dialogs for handling situations like this, I would be happy to work with you to get this added into our templates. Our current focus is on making the generated assets easier to understand/modify and be able to edit in Composer.