dialogflow / dialogflow-fulfillment-nodejs

Dialogflow agent fulfillment library supporting v1&v2, 8 platforms, and text, card, image, suggestion, custom responses
Apache License 2.0
598 stars 281 forks source link

HOW TO MAKE A PERMANENT SESSION? #253

Open DKLeoBR opened 5 years ago

DKLeoBR commented 5 years ago

hat if the user takes 30 minutes to respond? Dialogflow drops the intent. is there any way to make this intention infinite and wait for this "yes" or "no" for example User: I Need a T-shirt Bot: Yes, We Have, what color? User: Red Bot: Ok to Red T-shit, P, M or G? User: Wait, I'll see with my Wife

See the problem? Bot Ends session, and no matter if you set "lifespan" to 999 How to Solve this?

alexedtionweb commented 5 years ago

I have this same question and got this response from Dialogflow Team:

After some time has passed, an agent may become inactive and lead to slower responses. Dialogflow Sessions tend to last between 10-12 minutes and after that time range, the session will close. Thus, when you make another call, a new session ID will be generated.

Furthermore, Contexts have a lifespan of either 20 minutes or a certain number of requests by the user. Contexts hold information from previous parts of the conversation so if they expire, then queries and responses may be missing information.

While, a session will continue as long as there is an activity going, but if there is inactivity for more than 20-30 minutes, a session will get timed out and new session will be created. Once a new session is created that will be treated as a different chat duration.

If you start testing your agent after a period of inactivity, it may need a couple of requests to "wake up". To make sure that the agent is always awake, you can send scheduled automated requests to it (simulating user queries), for example, every 10-20 minutes. If you have webhook enabled in your agent, make sure that these requests hit your web service – this will ensure that your web service stays awake.

Cheers,

Shin

Dialogflow Support Team

ceekaymats commented 3 years ago

Hello, I have two Dialogflow agents connected to Facebook Messenger. I am using the handshake protocol to handle control as to which agent responds to which question. Is it possible to create a session that expires and automatically returns conversation control back to the primary agent after a specific time frame? Thanks