本文介绍了对话流程会话的生命周期是多长?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个聊天机器人,几天后用户需要继续聊天。因此,我计划存储会话ID,以确保用户可以在他离开的地方启动会话表单。
对此有任何解决方案吗?

I am developing a chat bot, where the user need to continue the chat after some days. So I am planning to store the session ID, to make make sure that the user can start the conversation form where he left.Any solution for this?

推荐答案

根据上下文的生存期为20分钟。这间接意味着该会话具有相同的生存期。但是,当我尝试此操作时,我感觉不到20分钟。这更像是10-20分钟。仅存储会话ID将无济于事。您将必须保存收到的响应的上下文,并在下次发送请求时将其发送。

According to the dialogflow documentation a context has a lifetime of 20 mins. Which indirectly means that the session has the same lifetime. But when I was trying this out I felt this is less than 20 mins. Which is more like 10-20 mins. Only storing the session ID won't help. You will have to save the contexts of the response received and send it with the request next time.

这篇关于对话流程会话的生命周期是多长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 01:35