You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the Intent has slot values for minutes or seconds handle_start_timer will get called with that otherwise it will provide “None”. One variant of this would be to also put the expected type into the decorator and let the decorator do the validation.
Another option: Just provide a helper function like mine in your module to get the slot values out of an intent. As you can see in my source (maybe I am doing it wrong) it is not that simple.
defextract_slot_value(intent: NluIntent, slot_name: str, default=None):
"""extracts the value of a slot"""slot=next(filter(lambdaslot: slot.slot_name==slot_name, intent.slots), None)
ifslot:
returnslot.value.get("value", default)
returndefault
See the forum. Quoting @DanielWe2:
Example code from https://github.com/DanielWe2/rhasspy-hermes-app/blob/examples/timer_app.py with a modification from https://community.rhasspy.org/t/mqtt-error-coroutine-get-test-was-never-awaited/1436/21?u=koan):
Usage in the intent handler function:
The text was updated successfully, but these errors were encountered: