Create a bot that authenticate the user before the conversation

Hello. I’m building a bot that have to authenticate the user. The authentication process is divided in two:

  1. the bot asks for the userid and check if that userid exists by calling an API. If the userid don’t exists, the bot should ask 3 more times for it. If after the 3 times the userid is never correct, the bot ends the conversation.
  2. the bot asks for two passwords and check if both passwords matches with the correct ones by calling an API. If the passwords matches the flow continues, if not the bot says goodbye.

I have two difficulties in this process:

  • How can I set a limited number of calls to a form?
  • How can I validate two slots at the same time?

Thank you

you can set a counter slot in your form

you can create a slot that would combine two slots, and validate it as one, then before using it, disambiguate it to two. Or in its validate function set 2 different slots

Thank you Ghostvv. Can you please show me how to create a counter slot and iterate it?

Another question, is that way to authenticate a user using rasa? Like with some token or something like that…

Thank you

it just like creation of any other slot, you need to add it to the domain and return appropriate SlotSet event in your custom action, please check the documentation about setting a slot in your custom action

what do you mean by authenticate a user?

Creating a bot that authenticates users before engaging in conversation is like putting a lock on the door before inviting guests in—smart move! Authentication adds a layer of security and ensures a smoother, more personalized interaction. Integrating a reliable verification API like ID Analyzer’s (Identity Verification API - ID Analyzer) can streamline the process, making it hassle-free for users. However, while it enhances security, it’s essential to maintain a balance to avoid making the user experience cumbersome.