如何更改订单预览中的筹码建议?

How to change the chip suggestions at the order preview?

我想用 DialogflowGoogle Assistant 以及 Google Transactions API 创建一个聊天机器人,让用户能够订购巧克力盒。现在我的代理包含以下四个意图:

我正在使用 Dialogflow Json 而不是 Node.js 将我的代理连接到交易 API。我想通过使用 Google 操作的 actions.intent.TRANSACTION_REQUIREMENTS_CHECK 操作来显示订单预览(订购巧克力盒时)。出于这个原因,在 Google 文档之后,当 Int1 被触发时,我正在使用一个 webhook 将 Google Assistant 连接到以下 python 脚本(后端):

from flask import Flask, render_template, request, jsonify
import  requests

app = Flask(__name__)

@app.route("/",  methods=['POST'])
def index():

    data = request.get_json()    
    intent = data["queryResult"]["intent"]["displayName"]

    if (intent == 'Int1'):

        proposedOrder = order.proposed_order(location)

        return jsonify({
                    "fulfillmentText": "This is your order preview:",
                    "payload": {
                              "google": {
                                "expectUserResponse": True,
                                "isSsml": False,
                                "noInputPrompts": [],
                                "systemIntent": {
                                  "data": {
                                    "@type": "type.googleapis.com/google.actions.v2.TransactionDecisionValueSpec",
                                    "orderOptions": {
                                      "requestDeliveryAddress": True,
                                    },
                                    "paymentOptions": {
                                      "actionProvidedOptions": {
                                        "displayName": "VISA **** **** **** 3235",
                                        "paymentType": "PAYMENT_CARD"
                                      }
                                    },
                                    "proposedOrder": proposedOrder

                                  },
                                    "intent": "actions.intent.TRANSACTION_DECISION"
                                }
                              }
                    }
                    })


if __name__== "__main__":
    app.run(debug=True)

其中 proposed_order 是我在模块 order 中编写的函数,它以 Google 文档指定的所需方式形成用户顺序。

intent == 'Int1' 时,这将向用户(在移动 phone Google 助手上显示订单预览,如下所示(示例来自 Google文档):

可以看到订单预览下方有3个筹码建议:下单更改支付方式, 没关系.

我的问题如下:如何(以编程方式)编辑这些芯片建议并添加我的(例如添加一个芯片建议 'Change number of items ordered' ?

在平台的订单中,您无法额外控制用户看到的选项。您希望在对话中添加一个中间步骤,以便在发送交易意向之前为他们提供预最终检查。