How to get latest bot response with Rasa Chatbot?
For getting user input we use : tracker.latest_message['text']
So, what is syntax for getting latest bot response ?
Thanks
How to get latest bot response with Rasa Chatbot?
For getting user input we use : tracker.latest_message['text']
So, what is syntax for getting latest bot response ?
Thanks
You can use the
tracker.events
list to fetch the latest bot event.This will go through the reversed list of events (making it from latest to oldest) and pick the first bot event using the
next()
function.The event will be have the following format:
There you can simply take the
'text'
param if you are only interested in the message.