Search code examples
azurebotframeworkazure-language-understanding

how to use Dispatch to find intent of two LUIS apps?


I want to build a chatbot with multiple LUIS and QnA models(https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=python).

There are two luis skills(HomeAutomation, Weather) and one qna skills(knowledge bot).

I have build two luis App ID and two Authoring Key. I have build one qna maker App ID and Authoring Key.

But in config.py, I only fond one LUIS_APP_ID and one LUIS_API_KEY. enter image description here

If there are two luis skills, why there are only one? Does I need to add one? If so, how to change bots/dispatch_bot.py?

enter image description here

by the way, if I only use one app id (e.g,Weather),the system says unrecognized intent:

enter image description here


Solution

  • If I understand correctly, you have two LUIS models that you want to use which have their own app IDs. If you do it this way, you need to use the Dispatch Command Line Tool as linked in this tutorial. This will create (in your case) a 3rd LUIS model created from your other two models. THIS is then the model that you would set up in the DispatchBot class where you are defining the LUIS model. I believe you can only set up this type of LUIS app through the command line, and you also need to update it via the command line if you add to the underlying LUIS apps.

    As an alternative, you can just create a single LUIS app with all of the required intents (basically your "manually" creating a dispatch app). In your example here, you would just have both your Home Automation intents and Weather intents in the same LUIS app. Most of the time I think this makes sense, and is what I have personally done. Unless you have a need to manage these subsets of intents in a separate LUIS intent, I personally don't see the need to add another layer of complexity. I see the use case more if you are trying to create a bot orchestrator that would invoke child bots.

    TL;DR you only use one LUIS app to dispatch, either use the Dispatch Command Line Tool or manually create a single LUIS app with all of the required intents.