有没有办法在 dialogflow cx 中恢复聊天?

Is there any way to resume a chat in dialogflow cx?

我正在尝试使用 DialogFlow CX 构建聊天机器人。我们有一个基于 DF ES 构建的现有聊天机器人,在上下文的帮助下,我们实现了恢复聊天功能,使我们的最终用户能够随时返回聊天并从他们中断的地方继续。因此,目前我们正在 CX 中构建完全相同的机器人,我们在重新创建简历聊天流程方面面临挑战。

因此,任何有关如何执行此操作的帮助都将非常有帮助。

提前致谢

Dialogflow CX conversation(会话)可以描述和可视化为状态机,配置为从最终用户收集信息或参数。此信息与该页面上的对话状态相关。请注意,对于每个会话轮次,当前页面将保持不变或过渡到另一页。这也适用于恢复或继续对话的当前状态。

以下是 continue/resume 对话的可能方法,方法是将以前收集的客户数据从以前的对话传递到新的对话中:

  1. 您可以使用 webhook wherein a function will store the parameter and forms you collected and use that to continue the chat from where the user left off during a conversation flow or a session. In the webhookResponse 创建自定义实现 您可以设置 fulfillment_responsetarget_page 字段和 session_info 字段更新并发回您从上一次对话中收集的存储参数。

    以下是如何从您的网络钩子响应传递会话参数、目标页面和履行响应的示例:

    {
       sessionInfo: {
           parameters: {
               param1: {
                 value: "sample1"
               }
           }
       },
      targetPage: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>,
      fulfillment_response: { 
           messages: [{ 
             text: [“This is where you left”],
           }] 
       } 
    }
    
  2. 您可以使用APIs or Client Libraries在detectIntent方法中设置queryParams.parameters和queryParams.currentPage。

    这是使用 REST API to set the QueryParameters of the detectIntent 方法请求正文的示例参考:

     {
        queryParams: {
            parameters: {
                  param1: {
                    value: "sample1"
                  },
        currentPage: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>,
            }
         }
    
     }