I am working on a bot where you can book a flight. I work with the latest version of the bot database (1.1) proposed here.
You can say things like, "Book me a flight from Amsterdam to Boston next Monday."
Now I configured LUIS for the response with the intent of "BookFlight", and in my bot I did LuisDialog and FormDialog as follows:
[LuisIntent("BookFlight")]
public async Task Process(IDialogContext context, LuisResult result)
{
var form = new BookFlightForm();
var entities = new List<EntityRecommendation>(result.Entities);
var formDialog = new FormDialog<BookFlightForm>(form, BuildForm, FormOptions.PromptInStart, entities);
context.Call(formDialog, OnComplete);
}
[Serializable]
public class BookFlightForm
{
[Prompt("From which city do you want to leave from? {||}", AllowDefault = BoolDefault.True)]
[Describe("Location, example: Amsterdam")]
public string LocationFrom { get; set; }
[Prompt("To which city you want to fly to? {||}", AllowDefault = BoolDefault.True)]
[Describe("Location, example: Las Vegas")]
public string LocationTo { get; set; }
[Prompt("When do you want to leave? {||}", AllowDefault = BoolDefault.True)]
[Describe("Departure date, example: tomorrow, next week or any date like 12-06-2016")]
public DateTime DepartureDate { get; set; }
}
I get the following response from Louis:
{
"intent": "BookFlight",
"score": 0.987034,
"actions": [
{
"triggered": true,
"name": "BookFlight",
"parameters": [
{
"name": "locationFrom",
"required": true,
"value": [
{
"entity": "amsterdam",
"type": "Flight::LocationFrom",
"score": 0.8548711
}
]
},
{
"name": "locationTo",
"required": true,
"value": [
{
"entity": "boston",
"type": "Flight::LocationTo",
"score": 0.962294638
}
]
},
{
"name": "departureDate",
"required": true,
"value": [
{
"entity": "next monday",
"type": "builtin.datetime.date",
"resolution":
{
"date": "2016-05-09"
}
}
]
}
]
}
]
}
Problem
The form is not populated with the correct values from LUIS. Thus, the bot will ask you to fill in your location, date and place where you want to fly. But this is already described by LUIS.
What have i tried so far
- - , , .
- "" "Flight:: LocationTo" "LocationTo" .. , .
- "BookFlightForm" , .
, , . LUIS? EntityRecognizer? A LUIS .
, !