Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I implement multiple LUIS dialogs on a single bot using the Bot Framework?

Since each LUIS model is limited to 20 intents and 10 entities, and also each model must have a well defined scope/domain, I'm wondering what's the best way to implement multiple dialogs in a single bot application, if I want my bot to be able to cover multiple domains, let's say for example get financial information and weather information.

I know that ideally I would have two different bots, but in this situation I need to do this with a single bot. I read the Bot Framework documentation on Dialogs (and several other parts) and the LUIS help page, but I wasn't able to find any information on how I could achieve that. I also gave a look at the examples and found nothing, is there a way to do this?

like image 552
adamasan Avatar asked Nov 03 '16 11:11

adamasan


1 Answers

So, from the technical standpoint there isn't any major issue with that. You just register two LUIS apps and have two dialogs in your app with the LUIS keys of the specific app you created.

I guess your question is going more to "how do I redirect the message to the corresponding LUIS bot". And it's valid question.

The AzureBot has a similar scenario and they resolved it using a DialogFactory that follows an strategy pattern. Each 'domain' dialog knows if the incoming message is something they can handle or not (this is the one for Virtual Machine operations). Here you can see how in their RootDialog they also have LUIS and how in the None/Empty intent they are redirecting the message to the corresponding dialog.

Another alternative to explore in this space, is using a IScorable interface, which, long story short, will basically allow you to intercept all the messages and decide what to do. The ContosoFlowers sample has a IScorable implementation for you to take a look at. The C# BotBuilder library has also the DeleteProfileScorable, that basically handle the /deleteprofile message.

like image 103
Ezequiel Jadib Avatar answered Sep 30 '22 18:09

Ezequiel Jadib