Resend latest bot respond in fallback action

How to get latest bot response ? For getting user input we use

tracker.latest_message['text']

In same way what is syntax for getting latest bot response ?

@Juste can you help me here?

You can get the latest action name with tracker.latest_action_name and latest bot utterance should be returned with tricker.latest_bot_utterance

@Juste thanks for you reply

  • tracker.latest_action_name is always action_listen which isn’t useful at all
  • tracker.latest_bot_utterance i couldn’t find this … i am using core version 0.13.2

i want to last message sent by the bot to the user so i can re ask the question again when fallback action is activated … i did this manually by using tracker.events[-4]['text'], is there a better way? if not I am thinking of adding this variable to the tracker object and Pull Request this as it’s very useful

Hi hossa95, did you find a better way of doing this? If so, could you please help me with it?

Thanks