How can I override utterance selection?


Currently, when you have multiple utterances examples for an utterance, one of them is randomly picked. In addition, slots that are not set are simply filled with None.

Is there a way to override the mechanism that selects which utterance to use? For example, we could have some utterance examples that contain a slot and others that do not have it. We could pick the right utterance depending on which slots have the information filled.

  - text: Hello {name}!
  - text: Hey there

Right now, we rely on an external NLG server to do this (which works fine) but it would be great to have this option without using an NLG server.

Cheers, Nicolas

Hello @nbeuchat

To write your own response logic, you can use a custom action that checks what slots are filled and then selects a template accordingly. You can also fill slots with default values right from the start, using the initial_value setting in the domain file.

Also, check out the response selector.