How can I override utterance selection? - Rasa Open Source - Rasa Community Forum
👋 Introducing the Rasa Playground
How can I override utterance selection?
post by nbeuchat on Nov 5, 2020
Hi!
Currently, when you have multiple utterance 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.
utter_greet:
- 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
post by j.mosig on Nov 5, 2020
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.