Return a message for user when no enttites is extracted

when the user type something that the nlu can’t understand or extract slots from i got this error which is expected,

but i want also to send a message for the user to like "i don't understand, can you repeat that" with that error i tried this

if not slot_values:
          dispatcher.utter_message("sorry couldn't get that,")
          raise ActionExecutionRejection(self.name(), "Failed to validate slot {0} , "with action {1}"
                                               "".format(slot_to_fill, self.name()))

but the message doesn’t appear for user, any help with that?

Hello, Checkou the FallbackActionPolicy described in fallback actions chapter of the documentation, which describes how to use this policy, which determine default action, when bot did not understood the usr input or is not sure what to do. Cheers!

1 Like