I’ve got a slot filling form all working quite nicely with some custom validation logic within each slot. All working well so far.
However, I would like to help the user with buttons when I need them to disambiguate if the entity entered did not exactly match the entity from a list (based on my cosine similarity validation logic). I therefore need to dynamically add buttons to the default “utter_<form_name>” in my domain file.
Is there a way to override the action that displays the utter in my form?
Hi @pomegran I believe you can do this. Let me make sure I understand the problem. You are validating the user input of a slot. During that validation you’re checking if that value is acceptable using some criteria. If the value is valid you’d like to continue with the form. If the value is not valid you’d like to offer some dynamic button choices of the closest options based on your cosine similarity results?
Yep, that’s exactly it Matthew. I have my utter_<> in my domain setup already, but I’d like to dynamically add buttons to it based on a validation criteria (cosine similarity match) I currently have setup.
It’s possible. You need to use custom actions instead of utter_ask{slot_name}, you need to use action_ask_{slotname} and write logic in the custom actions.
Ok, just to be clear, I just need to create a custom action called e.g. ‘action_ask_panel’? How does this get called in a form? Does it get called "under the hood’?
I’ll take a look this morning though, thanks for the speedy response!
After creating the action_ask_panel in your actions.py, list down the action_ask_panel in domain.yml file under actions just like any other action name.
The action will be called automatically by the Form Logic.