Google对话框流程中的多个响应操作

时间:2018-02-10 04:24:24

标签: actions-on-google dialogflow google-assistant-sdk

如何使用对话框流程在Google控制台上获取多个操作响应? 我模仿谷歌控制台上的动作,但只显示了两个响应 第三个响应未显示的地方

这是我的json回复

{
    "source": "webhook", 
    "data": {
        "google": {
            "is_ssml": true, 
            "permissions_request": null, 
            "expect_user_response": true
        }
    }, 
    "messages": [
        {
            "type": 0, 
            "speech": "peter Got around 28 marks in maths. which is ranked 1 among 3 candidate in class 1"
        }, 
        {
            "textToSpeech": "peter Got around 28 marks in maths. which is ranked 1 among 3 candidate in class 1", 
            "platform": "google", 
            "displayText": "peter Got around 28 marks in maths. which is ranked 1 among 3 candidate in class 1", 
            "type": "simple_response"
        }, 
        {
            "textToSpeech": "Working", 
            "platform": "google", 
            "displayText": "Working", 
            "type": "simple_response"
        }, 
        {
            "textToSpeech": "Working 2", 
            "platform": "google", 
            "displayText": "Working 2", 
            "type": "simple_response"
        }
    ]
}

这是我的控制台输出

enter image description here

非常感谢任何有关此事的帮助

谢谢

关心赛义夫

3 个答案:

答案 0 :(得分:0)

只接受两个简单的回复作为回复。如果您想要更多内容,则需要将文本合并为两个回复中的一个。

答案 1 :(得分:0)

正如您在AoG Responses docs上看到的那样,它被指定为一项要求:

  

每回合最多2个聊天气泡

因此,您的第三个气泡将不会显示,正如Google预期的那样。

正如尼克的上一个答案所建议的那样,您需要合并文本并将所有内容包装在2个气泡中​​。在一个简单的响应中,可以通过在需要的地方添加\n来换行。

但是,在Basic Card中,您可以访问markdown的有限子集,如我提供的docs链接所述:

  

New line with a double space

     

**bold**

     

*italics*

答案 2 :(得分:0)

丰富的响应具有以下要求和可配置的可选属性:

  1. 在带有actions.capability.SCREEN_OUTPUT的表面上受支持 能力。
  2. 丰富响应中的第一项必须是简​​单响应。
  3. 最多两个简单的答案。
  4. 最多一张基本卡或StructuredResponse。
  5. 最多8个建议筹码。 (您也可以添加8个以上的字符,但会收到警告而不是错误消息。)
  6. FinalResponse中不允许使用建议筹码
  7. 当前未从智能显示器链接到网络 支持。