Select utter message if slot has a value


Chan I avoid using custom actions in case when slot has or do not has value. For example: If slot “name” has a value I do not what to ask username, just say “Hi again, {name}” if not “Hi, what is your name?”

Hello @KabaninArtem,

There are 2 options with slots you can do the custom actions like you mentioned which is really for more advanced things after you have the slot data, like making an API call, etc with that data.

The other option would be to do something like we have in our docs at Slots where you just setup the slot in the story/nlu training and if its not in the slot it will ask for it, etc.

Let me know if this is unclear after reading over it and if you have further questions.

Hi @btotharye, thnaks for your answer)

Is I understood, I can write my stories in this way:

- slot{"name": "Artem"}
utter_say_hi{{"name": "Artem"}

* greet

In first example case when I have slot value already Second one when I need to ask it. Right?


You got it, let me know if you see any issues with this as you proceed.

1 Like