So using the Rhasspy Hermes App wrapper is pretty straight forward in implementing custom skills using the provided examples that are triggered by a specific intent. But how do you pass other arguments that are available via the JSON message sent from Rhasspy for a specific intent? For example, I have created an intent and two numeric variables are part of the intent trigger sentence:
[SetFMStation]
set radio to f m (88…108){channel} point (0…9){channel1}
So using the Rhasspy Hermes App wrapper you trigger your python app with:
…
@app.on_intent(“SetFMStation”)
async def set_fm_station(intent:NluIntent):
the program logic…
How do I get {channel} and {channel1} variables out of the JSON message sent by Rhasspy??
Entity channel value and entity channel1 value in the JSON sent below is what I need.
JSON sent my Rhasspy
{
“entities”: [
{
“end”: 19,
“entity”: “channel”,
“raw_end”: 28,
“raw_start”: 17,
“raw_value”: “ninety nine”,
“start”: 17,
“value”: 99,
“value_details”: {
“kind”: “Number”,
“value”: 99
}
},
{
“end”: 27,
“entity”: “channel1”,
“raw_end”: 38,
“raw_start”: 35,
“raw_value”: “one”,
“start”: 26,
“value”: 1,
“value_details”: {
“kind”: “Number”,
“value”: 1
}
}
],
“intent”: {
“confidence”: 1,
“name”: “SetFMStation”
},
“raw_text”: “set radio to f m ninety nine point one”,
“raw_tokens”: [
“set”,
“radio”,
“to”,
“f”,
“m”,
“ninety”,
“nine”,
“point”,
“one”
],
“slots”: {
“channel”: 99,
“channel1”: 1
},
“text”: “set radio to f m 99 point 1”,
“tokens”: [
“set”,
“radio”,
“to”,
“f”,
“m”,
“99”,
“point”,
“1”
],
“wakeword_id”: “default”
}