microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

How to set a default value for FormFlow #541

Closed Johndgnzj closed 8 years ago

Johndgnzj commented 8 years ago

Hi I would like to use FormFlow to obtain information, but before that I will be the first to LUIS analyze whether the sentence has been part of Form data, this way, you do not need much of a question and answer format.

If i base on "SimpleSandwichBot", i have to collect Sandwich, Length, Bread, Cheese, Toppings… i want to build a bot can do such thing like

Me: Hi Bot: Hi, how can i serve you? Me: i want a 6 inch BuffaloChicken sandwich with NineGrainWheat bread.

After this text send to LUIS, i get data return like :

{intend:buySandwich,...}
entity{
length:6 inch,
sandwich:BuffaloChicken,
bread:NineGrainWheat,...
}

I wanna ask for how to set this value to my SandWichOrder and reply user a message for asking remaining data.

willportnoy commented 8 years ago

There is a sample where a LUIS dialog calls into FormFlow - is this what you need?

https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Samples/PizzaBot/PizzaOrderDialog.cs#L36

Johndgnzj commented 8 years ago

sorry i take many time to study this code, but i don't really know how it works. in my understanding to this "ProcessPizzaForm" it received LUIS object, than get the entities what it need and use it to create a PizzaForm,return a PizzaOrder with it, Am i right?

it would be helpful if there have more comment of this sample code.

willportnoy commented 8 years ago

Yes, that's the correct. Feel free to open a new issue with specific questions about the sample. You might consider running the sample locally with bot emulator to explore how it works.