Does Rasa have an in-built Timer

Hi Rasa Team,

Does Rasa have an in-built Timer ?, Where It can measures the user response time, when he/she sends next input message to the bot.

It would be really helpful for my project. Currently I am using system time to measure user response time based on that I am doing back end calculations.

Is there any docs available, I can refer too?

We don’t have an explicit timer. However, we store the timestamp on each of our events. So whenever the user or the bot says something the timestamp is stored on the event itself (see, for example, here). You can get the list of events from the tracker tracker.events in your custom action. Does that help?

Wonderful @Tanja, :grinning:

But, I quietly do not understand the numbers on timestamp variable. Kindly could please explain me. How timestamp is being calculated here.

tracker [
{'event': 'action', 'timestamp': 1592218476.5106592, 'name': 'action_session_start', 'policy': None, 'confidence': None}, 
{'event': 'session_started', 'timestamp': 1592218476.5106592}, 
{'event': 'action', 'timestamp': 1592218476.5106592, 'name': 'action_listen', 'policy': None, 'confidence': None}, 
{'event': 'user', 'timestamp': 1592218476.8268125, 'text': 'hi', 'parse_data': 
1592218476.8268125
{'intent': 
{'name': 'greet', 'confidence': 0.9996538162231441}, 'entities': [], 
'intent_ranking': 
[
{'name': 'greet', 'confidence': 0.9996538162231441},
{'name': 'mood_unhappy', 'confidence': 0.00017485288844900002}, 
{'name': 'mood_great', 'confidence': 5.885763675905765e-05}, 
{'name': 'affirm', 'confidence': 5.0365699280519045e-05}, 
{'name': 'deny', 'confidence': 4.707726475317032e-05}, 
{'name': 'bot_challenge', 'confidence': 1.1105165867775211e-05}, 
{'name': 'goodbye', 'confidence': 3.927943907910958e-06}
],

Like it takes system time and updating on events when its called or something else.

The timestamp is coming from pythons

time.time()

You should be able to convert it to a proper date via something like this

In [1]: time.time()
Out[1]: 1347517739.44904

In [2]: time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()))
Out[2]: '2012-09-13 06:31:43'
2 Likes