Rhasspy interactive a simple idea (external command JSON trigger continueSession)

I was thinking about how to make rhasspy simply interact whilst keeping the whole system relatively simple.
I am using the local command intent handling and it occured to me that if the
json returned interact = true
that could be used to trigger the wake word a second time ( using the speech value as the second Wake Wav. --presuming you use rhasspy for this–
This could work add infinitum.
ie
rhasspy <
yes >
play the radio <
ok > trigger handler
handler retruns {“speech”: “Which station?”, “interact”: “true” …}
rhasspy plays speech and triggers wake word listen for intent.

rinse and repeat as required

I started to dig through the code but that is one big rabbit hole :slight_smile:

That can be done already with customData I guess.
customData can be a json with, well. customData :slight_smile:

You might want to look into that

yeah thanks
I saw that in the json
but where do I did to find out how to use it?
Or at least get it to fire a process in rhasspy?

You can inject it in any message and it will get relayed in all subsequent messages :slight_smile:
So if you inject in the intent handler, it will be available in all messages after that.

but then you have to say the ket word again to trigger another response.

how could I trigger the second responce within rhasspy
that is really my question /idea I guess.

state can be handled by the external code anyway.

I obviously haven’t dug into the mqtt. I control my stuff directly or over i2c

Sorry, I misread a bit. You want an interaction, not just some extra data.

You can use the continueSession for that.
In the documentation you can read some more:

https://rhasspy.readthedocs.io/en/latest/reference/#dialogue-manager

Basically:
1 Rhasspy wake up
2 Command spoken → Intent handling
3: Intent handler (the whichstation in your case) should not use endSession, but continueSession. Optionally use the intent filter and customData for context
4 The last intent sends message to endSession.

Ok thanks
Sorry I didn’t clarify exactly
I am using Command as my intent handler and not MQTT.
ie intent handling
"Calls a custom external program with intent JSON on standard input "

So to be clearer (and with your help maybe I can phrase my request better)

I just wanted the JSON returned from the external command to be able to set
continueSession.
It looks like that is only avaiable via MQTT.

if I could return continueSession: true,
as a json element with
text: “which station?”,
customData, “play_station”

rhasspy listens for the next intent ie one specific for station choice.
and calls the external program with the same sessionID and customData and new intent

Now that would be perfect. (for me :slight_smile: )

That is not a problem, but the dialogueManager still uses MQTT, so you should do so as well to communicate with the dialogueManager.

Currently the JSON return can indeed not trigger continueSession I think, so that might be a good addition.
You can however implement sending a MQTT message in your intent handling command.

Yep thanks that is what I thought. Thanks heaps for your help it’s a rather large rabbit hole this one.