Hello!
I’m trying to let Rhasspy know when something has gone wrong during the intent handling (can’t connect to an external service or the user has tried to do something invalid) and I want the session to end (as opposed to timeout) and play the error sound at the correct location.
This is what I tried:
def _error(self, client, site_id, session_id, custom_data):
# I tried a lot of different variations of the following, but none of them quite worked
# the "continueSession" got close, but would re-beep and then error, which not quite right
# I disabled/enabled these as needed depending on the message I was trying to publish
notification = {
"siteId": site_id,
"sessionId": session_id,
"customData": f"{custom_data}",
"error": f"{custom_data}",
"termination": "error",
}
print(notification)
client.publish("hermes/dialogueManager/intentNotRecognized", json.dumps(notification))
client.publish("hermes/dialogueManager/sessionEnded", json.dumps(notification))
client.publish("hermes/error/dialogueManager", json.dumps(notification))
client.publish("hermes/error/nlu", json.dumps(notification)) # probably not this one!
and the notification print would look something like this (again sort of depending on what was in the message):
{'siteId': 'default', 'sessionId': 'default-jarvis_linux-e0be5916-5742-48cc-b2e1-14857fbeacd0', 'customData': 'Timer has to be set for more than 0 seconds'}
I’m curious which is the right message to publish to and if the behavior I’m looking for (play the error beep) makes sense.
My workaround is just to play the error sound with playBytes
and call hermes/dialogueManager/endSession
.
Let me know!