I built a chatbot using the instructions given in
and it’s working absolutely fine.
But the problem with this approach is that I have absolutely no control over the user messages and rasa responses i.e., whatever user send the rasa pipeline work on it and send the response back to the user.
But instead of that I want the control of user messages and rasa responses in my hand i.e., I want that I first grab the message sent by the user and do some custom processing on that user message and after that I sent that processed message to rasa which then split the response back to me and then I do some custom processing on the response splitted by rasa and then i send that processed response to my telegram bot.
so I want some functionality like -->
if user_msg == ‘I love you’ :
send_response_to_telegram_bot(‘I love you to’)
rasa_response = get_response_from_rasa(usr_msg)
processed_response = apply_some_custom_functionality(string = rasa_response) send_response_to_telegram_bot(processed_response)
I first check if the user message is ‘I love you’ and if it’s true than I don’t need to pass that message to rasa and I simply sent a reponse ‘I love you to’ back to user using function send_response_to_telegram_bot(). But if the user message is something else than I pass the message to rasa using get_response_from_rasa() and rasa returns it’s reply which I stored in a variable rasa_response. I then passed the rasa_response to a function called apply_some_custom_functionality() to add some extra things to the rasa_response and stored in a variable processed_response. And finally I send the processed_reponse from the bot to the user using function send_response_to_telegram_bot().
All the functions defined above are just for demonstration purpose.
How to achieve such a functionality?
I am an absolute beginner in rasa, and started using it from last week so any suggestion/code-snippet/example/blog will be helpful.