Prompt for missing slot

Howdy, finally got Rhasspy, HA & MaryTTS working together, super impressed!!! I’ve got ChangeLightState set up as an Intent in HA, and can turn on/off my living room lamp. I’m wondering is there is way to have a “conversation” between Rhasspy & HA if an utterance is missing a slot; e.g. if I were to say “Turn on the lamp” rather than “Turn on the living room lamp” to have Rhasspy to HA prompt “Which light?” and subsequently fill in the slot for HA to act on. I think this would be helpful reducing the number to sentences that need to be trained & recognized, as well as to a user friendliness factor. Thanks!

This feature is currently a work in progress and it’s not ready to use yet. If you are an experienced programmer, you could try writing your own code for this function.

Unfortunately I have no know-how about HA, due to not using it.

But take a look at the topic

about a possibility to develop your own intent handlers in a straightforward way using Python.

Especially the methods ContinueSession and EndSession could be of interest for you.

I use it in the way that if some slot value is missing, I first try to extract the information myself (out of the siteId mainly) and directly then carry out the action using EndSession; otherwise if that does not suceed - I simply ask the user, using ContinueSession.

Thank you, I’ll take a look. (ps, love the username!)

Coincidentally I just added an example app yesterday of continuing a session in rhasspy-hermes-app:

However, this is an easier case: this app just asks for a confirmation (yes/no). Note that currently the custom_data attribute doesn’t seem to work yet, but maybe it’s not needed in your case.

So in your intent handler you try to extract the slot value with something like If there are missing slots, continue the session with a question for the missing slot. Then in the intent handler fired by telling the slot, again try to extract the slot value. If it’s there, you have all the information you need.

However, I’m not sure what’s currently the best way to forward to Home Assistant the original intent with the slot filled in by the later intent. Snips had a hermes/nlu/partialQuery message for a follow up query to extract a specific slot given an intent, which should solve this, but Rhasspy doesn’t support it yet. So for now, everything you try would be a bit of a hack :slight_smile:

Thanks Koen! good to see you involved with rhasspy, I remember you from snips land and was always impressed with your work.

1 Like