Hi,
So, I have this custom action, through which I want to return an utterance with the command dispatcher.utter_message(response=<template>, <var_name>=<var_value>
.
The template I want to trigger has different utterances, which have different numbers of variables. For example, one is “I found no restaurants in the {area} area”, another one is “I found no restaurants in the {area} area with {price} price range”.
What I want is the system to understand that if I pass 1 variable it has to select an utterance with 1 variable, if a pass 2 variables it has to select an utterance with 2 and so on. Is that possible? What it does now is selecting random utterance from the template and placing None in the variables that are not passed. How can I solve this? (making a different template for every number of variables is unfeasible as I don’t know in advance how many a user can ask for).
Thank you, Tiziano