Hi all,
I try to get the last bot utterance and check whether it is a specific utterance to then suggest a topic. However, I want to do so for a retrieval intent. I fear that is not possible but maybe one of you has a hack on how to achieve it somehow.
My action for getting the last bot action is like this:
def get_last_utter_action(tracker):
for event in reversed(tracker.events):
try:
if event.get('name') not in [ 'action_listen', None, 'utter_ask_continue' ] :
last_utter_action = event.get('name')
return last_utter_action
else:
pass
except:
pass
return []
And if I have for example a lot of FAQs this action would give me “utter_faq” as a return. However, I would like to know the exact utter_faq e.g. utter_faq/costs.
Do you have any idea whether this information is also stored somewhere in the tracker and how to access it?
That would be soo great! :))