I have a backend service where users can create and name rooms and devices. I'd like to integrate with Cortana and allow users to interact with their devices using Cortana. I created a bot that is hosted on my backend and added Cortana as a channel. I also integrated the bot with my OAuth 2 server so I know which user is interacting with the bot. I trained my LUIS model with phrases like "turn on light in the bathroom", "turn off all lights", etc.
My issue: each user can name rooms and devices as they want. I do not know in advance which rooms and which devices are going to be configured in the service. When I get the request in my bot, I can find all devices for the user. The list is fixed at that point and could be used as a phrase list - only devices in the list are allowed to be in the request.
Which brings me to my question: is it possible to modify the phrase list on per-user basis? Or configure a URL from which the most recent phrase list could be retrieved before the request is processed by LUIS? Basically all I need is to avoid getting a request to turn on light in the "living room" while there is no living room configured by the user in the system and instead it should have been "dining room" (this is just a simple example, in the real world it would be more complex).
I know there is LUIS REST API that can be used to dynamically modify the configuration, but: 1) it is not on per-user basis 2) it requires re-building and re-publishing the LUIS model
I believe the Connected Home skills solve that somehow by discovering all devices connected to the service, but I haven't found any APIs I could use to solve the issue in my skill.
Edit: I am looking for a functionality like this: Cortana Connected Home After linking the Hue account Cortana knows which devices the user has and at that point the voice recognition can be smart and try to map the spoken words to an actual device name.
Firstly, the phrase list feature can help LUIS recognize intents and entities, it will affect on that whole LUIS app. As far as I know, there are not concept of per-user basis phrase list feature in LUIS.
Secondly, LUIS app support 5,000 items per phrase list, if the number of your app system rooms (or devices) name does not exceed the limit, you can add all rooms’ name in a phrase list (and add all devices’ name in another phrase list).
Besides, you can also try this approach: when users can create and name rooms and devices, you can map information about user with rooms&devices and store the map information in a external store, such as a database etc. And if you pass query to LUIS, LUIS would help detect the intent and the entity(or entities or empty entities list), if there are not any entity in entities list, you can query records of rooms’ name from that external store and prompt the user for selecting a room.
Code snippet:
Test result: