How to use a button payload to call intents that have special characters?

Hey all,

I have lots of intents for a new bot and they have a pattern that contain some punctuations and special characters like ‘(’, and ‘)’ and also ‘.’ and ‘,’.

I am using a custom fallback action derived from here:

But how can I add a string like this to the payload for it making a valid call? When I pass something like ‘abc(xyz())’ as an intent, Rasa recognizes just part of the string, as ‘abc(xyz(’.

buttons = [{'title': 'Yes',
           'payload': '/{}'.format(last_intent_name)},
          {'title': 'No',
           'payload': '/out_of_scope'}]

Any help on this would be great!

@bayesianwannabe Not sure I can follow. So you have an intent that is called abc(xyz()) and which is listed in your NLU training data file with some examples. You have a custom fallback action that takes the latest intent name to verify if the intent is correct or not. However, the intent name is not the same as in the NLU training data file as some of the special characters were removed. Is that correct?

How does your config file look like? And what Rasa version are you using?

Hey, thank you for your answer.

That is correct. I was using version 1.9.0 and my workaround was to change the character ‘)’ to ‘]’. Now my intents follow the format: ‘abc[xyz[]]’ instead of ‘abc(xyz())’.

I ended up discovering that the issue was happening just with the ‘)’ character, as I stressed a bunch of special characters to check if I would have any limitation with any of them.

Dots, comma, colon or semicolon were all OK, but it seems to have a particular issue with the ‘)’ character: the default fallback action was always showing that no intent called ‘abc(xyz(’ were found when the intent was registered as ‘abc(xyz())’ in the domain.yml as well as the call in the custom action.

The change of characters solved but of course I had to edit some of my codes.

I think that anyone that declares a intent that uses a ‘)’ character and call it from a button will be able to check this issue. It was an issue that I only observed while using the payload of the button in a fallback action.