【问题标题】:Dialog Flow Response: actions On googleDialogflow 响应:Google 上的操作
【发布时间】:2018-12-05 16:21:40
【问题描述】:

我有一个带有 BasicCard 的简单响应的响应。从对话流到 Google 助手的响应是这样的:

"payload": {
        "google": {
            "expectUserResponse": true,
            "richResponse": {
                "items": [
                    {
                        "simpleResponse": {
                            "textToSpeech": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)",
                            "displayText": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)"
                        },
                        "basicCard": {
                            "image": {
                                "url": "https://",
                                "accessibilityText": "The model number can be found here "
                            },
                            "title": "The model number can be found on here,
                            "subtitle": "It is also called Set-Type,"
                        }
                    }
                ],
                "suggestions": []
            }
        }
    }

在响应 GA, Simulator 我收到以下错误:

expected_inputs[0].input_prompt.rich_initial_prompt: the first element must be a 'simple_response', a 'structured_response' or a 'custom_response'.

GA 响应我在模拟器中看不到简单响应..在某个地方简单响应被丢弃了..DialogFlow 的这个响应有什么缺陷吗?

【问题讨论】:

  • 您是否使用代码来定义响应?
  • 您说您在模拟器中看不到简单的响应。您能否更新您的问题以包含来自模拟器的全部回复?

标签: dialogflow-es actions-on-google


【解决方案1】:

问题是items[] 数组中的每个对象都应该有一个字段来指示项目的类型。因此,一项将具有具有相应值的 simpleResponse 属性。另一个项目将有一个basicCard 属性,其中包含它的所有值。

items[] 数组中似乎有一个对象,它具有两个属性,simpleResponsebasicCard。将它们拆分为数组中的两个对象。像这样的:

                "items": [
                    {
                        "simpleResponse": {
                            "textToSpeech": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)",
                            "displayText": "Can you tell your TV's model number? (Eg. 42PFL7008S/12)"
                        }
                    },
                    {
                        "basicCard": {
                            "image": {
                                "url": "https://",
                                "accessibilityText": "The model number can be found here "
                            },
                            "title": "The model number can be found on here,
                            "subtitle": "It is also called Set-Type,"
                        }
                    }
                ],

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-08
    • 2019-07-30
    • 1970-01-01
    • 2019-04-25
    • 1970-01-01
    • 2020-01-24
    相关资源
    最近更新 更多