intents
intents copied to clipboard
Missing an option for capturing area prepositions
There does not seem to be a way to
- name areas in their basic form (
living room,kitchen,terrace) - capture the preposition used with area name (
[in|on|at]) and correctly reflect the form used by the user in response.
This approach seems to do the job:
-- common.yaml
expansion_rules:
area: "[{area_prepositions:preposition}] {area}"
lists:
area_prepositions:
values:
- in
- on
- at
-- fixtures.yaml
areas:
- name: "kitchen"
id: kitchen
- name: "living room"
id: living_room
- name: "terrace"
id: terrace
-- responses/..
intents:
..
default: "Doing something {{ slots.preposition | default() }} {{ slots.area }}"
When testing with parse --sentence the sentence is correctly interpreted, slots are set as follows:
{
"slots": {
"device_class": "light",
"preposition": "on",
"area": "terrace",
"domain": "light"
},
"response": "Doing something on terrace",
The problem here is that this will not pass the tests:
AssertionError: Intent xyz does not support slot 'preposition'. See intents.yaml for supported slots
Overall I am missing a way to capture a piece of text (similar to regex groups) and then use it in responses.
Good idea @jose1711 🙂 What do you think about this? https://github.com/OHF-Voice/hassil/pull/229
Good idea @jose1711 🙂 What do you think about this? OHF-Voice/hassil#229
I very much like your proposal and can't wait to be able use the captures in the intents.