0
votes

I have an intent in LUIS called ChangeFlight. I can extract the date entity when user input some kind of date format initially. When the user forgets to input some date, it will ask the user to input a date.

However, I don't want to just get the results of the response, instead, I want it to extract the date entity such as the initial step. I have bot.dialog('askForDate') which asks for date from user but I am not sure how to extract the builtin date entity in the middle of the conversation.

How should I handle this? Thanks.

1
Does Nicolas' answer solve your question? If you need more information on how the datetime parsing in Prompts.time works, the SDK uses chrono. If users' datetimes are still not being properly parsed then you may want to plug in a NLP like LUIS.ai to aid in deciphering utterances.Steven G.

1 Answers

0
votes

You can use the Prompt dedicated for time resolution, it will allow a user to input a time or date/time. doc is here.

For example:

function (session, results, next) {
    if (results.response) {
        session.dialogData.name = results.response;
        builder.Prompts.time(session, "What time would you like to set an alarm for?");
    } else {
        next();
    }
},
function (session, results) {
    if (results.response) {
        session.dialogData.time = builder.EntityRecognizer.resolveTime([results.response]);
    }
     
    // TO DO : add here what you want to do with the value
}