I want to stop the conversation after a particular intent provided by the user. Can I create a custom action that does the same?
What do you mean by stop? like the customer can’t ask any more questions or do you just want the bot to forget everything about the user?
You can restart the conversation so the bot forgets all contextual information https://rasa.com/docs/core/api/events/#restart-a-conversation
I mean whatever the customer types, bot should not respond. I wanna know if there is a custom action for that?
https://rasa.com/docs/core/api/events/#pause-a-conversation
You can pause it, every message to the bot will be ignored
ok thanks man. I have another question. Do you know how to send shortened links through the bot as replies? The frontend is capable of handling links.
You want the links to be programmatically shortened ? use a custom action and use some library to shorted your links and send it back to the user
I am storing responses as custom actions in a dictionary. I’ll give you an example.
payroll_dict = { ‘block payroll’: ‘To block the payroll of an employee, click on Payroll and choose Block Employee Payroll.’, ‘block the payroll’: ‘To block the payroll of an employee, click on Payroll and choose Block Employee Payroll.’, ‘payroll blocking’: ‘To block the payroll of an employee, click on Payroll and choose Block Employee Payroll.’, }
class ActionRollpay(Action): def name(self): return ‘Action_Rollpay’
def run(self, dispatcher, tracker, domain):
pa_yroll = tracker.get_slot('pay_roll')
if pa_yroll in payroll_dict:
reply = payroll_dict[pa_yroll]
else:
reply = "It is so odd that I don't have this info on vE. I'm afraid you have to contact the user account manager."
dispatcher.utter_message(reply)
return [SlotSet('pay_roll', pa_yroll)]
And there is an additional requirement that the link should have the name i desire. Like click here
Do you have any idea of how to do it?
Hi, I think what he think is after the user provide a particular intent, the bot will stop the conversation without letting the user enter /stop I am also looking for way to do this but the documents that you tagged is not available anymore.