DialogFlow 中的 fulfillmentText 与 fulfillmentMessages

fulfillmentText vs fulfillmentMessages in DialogFlow

我正在制作一个 Chatbot,目前正在使用 Google Hangout Chat,但将移植到其他聊天平台。
聊天代码在 Node.js 后端处理,意图识别是使用 DialogFlow 的 Nodejs API 完成的。

环聊回复如下:

{
  thread: {
    name: thread.name
  },
  text: 'The response in text',
  cards:['List of cards to show data']
}

数据工作正常,但我无法解析从 DialogFlow 获得的响应并确定响应的 text 属性。有两个选项可以选择发送为 text 属性。一个是 queryResult.fulfillmentText,它只是一个字符串,很容易分配给 text 属性,而另一个是 queryResult.fulfillmentMessages,它是一个包含某处相同文本的对象数组。这就是我的情况:

"fulfillmentText": "We could find few matching products based on your query",
"fulfillmentMessages": [
  {
    "text": {
      "text": [
        "We could find few matching products based on your query"
      ]
    }
  },
  {
    "text": {
      "text": [
        "2nd text"
      ]
    }
  }
],

我的问题是我应该在fulfillmentTextfulfillmentMessages之间使用什么?还有他们两个有什么区别。为什么会有多个 texts/messages,鉴于环聊聊天只需要一个文本响应?

PS:我正在使用 DialogFlow V2 API

Dialogflow Docs

得到这个
  • fulfillmentText (String) Text to be pronounced to the user or shown on the screen.
  • fulfillmentMessages (Object) Collection of rich messages to show the user.

所以我应该使用 fulfillmentText 作为 Hangout Chat 响应的 text 属性 发送。 fulfillmentMessages 用于 "Rich Messages",例如我从数据库生成的卡片。