在Google操作系统SDK中的操作中,点按轮播项目可识别为' VOICE'?

时间:2017-10-18 18:39:54

标签: actions-on-google

我使用轮播(type.googleapis.com/google.actions.v2.OptionValueSpec)来显示多个项目 当我在模拟器上单击旋转木马中的一个项目时,通过单击鼠标指针选择旋转木马中的一个项目识别为inputType:VOICE而不是inputType:TOUCH。有没有人得到相同的行为或是一个预期的行为? 我正在研究这个问题的原因是因为我想让只有actions.capability.SCREEN_OUTPUT设备的用户通过使用其中一个轮播项目或建议气泡来输入。

这是我在模拟器中可以看到的(屏蔽的)DEBUG日志:

{
  "agentToAssistantDebug": {
    "agentToAssistantJson": {
      "conversationToken": [conversationToken],
      "expectUserResponse": true,
      "isInSandbox": true,
      "expectedInputs": [
        {
          "possibleIntents": [
            {
              "intent": "actions.intent.TEXT"
            }
          ],
          "inputPrompt": {
            "richInitialPrompt": {
              "items": [
                [items]
              ],
              "suggestions": [
                [suggestions]
              ]
            }
          }
        }
      ]
    }
  },
  "assistantToAgentDebug": {
    "assistantToAgentJson": {
      "user": {
        "userId": [userId],
        "locale": "ja-JP"
      },
      "conversation": {
        "conversationId": [conversationId],
        "type": "ACTIVE",
        "conversationToken": [conversationToken]
      },
      "inputs": [
        {
          "intent": "actions.intent.OPTION",
          "rawInputs": [
            {
              "inputType": "VOICE",
              "query": [some text]
            }
          ],
          "arguments": [
            {
              "name": "OPTION",
              "textValue": [some text]
            }
          ]
        }
      ],
      "surface": {
        "capabilities": [
          {
            "name": "actions.capability.AUDIO_OUTPUT"
          },
          {
            "name": "actions.capability.SCREEN_OUTPUT"
          }
        ]
      },
      "device": {},
      "isInSandbox": true,
      "availableSurfaces": [
        {
          "capabilities": [
            {
              "name": "actions.capability.AUDIO_OUTPUT"
            },
            {
              "name": "actions.capability.SCREEN_OUTPUT"
            }
          ]
        }
      ]
    },
    "curlCommand": "curl -v [backend_url] -H '[headers]' -X POST -d '{\"user\":{\"userId\":\"[userId]\",\"locale\":\"ja-JP\"},\"conversation\":{\"conversationId\":\"[conversationId]\",\"type\":\"ACTIVE\",\"conversationToken\":\"[conversationToken]\"},\"inputs\":[{\"intent\":\"actions.intent.OPTION\",\"rawInputs\":[{\"inputType\":\"VOICE\",\"query\":\"[some text]\"}],\"arguments\":[{\"name\":\"OPTION\",\"textValue\":\"[some text]\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]},\"device\":{},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]}]}'"
  }
}

EDIT 这是我的webhook从AoG获得的(蒙面)JSON:

{
    "user": {
        "userId": "[userId]",
        "locale": "ja-JP"
    },
    "conversation": {
        "conversationId": "[conversationId]",
        "type": "ACTIVE",
        "conversationToken": "[conversationToken]"
    },
    "inputs": [
        {
            "intent": "actions.intent.OPTION",
            "rawInputs": [
                {
                    "inputType": "VOICE",
                    "query": "[some text]"
                }
            ],
            "arguments": [
                {
                    "name": "OPTION",
                    "textValue": "[some text]"
                }
            ]
        }
    ],
    "surface": {
        "capabilities": [
            {
                "name": "actions.capability.AUDIO_OUTPUT"
            },
            {
                "name": "actions.capability.SCREEN_OUTPUT"
            }
        ]
    },
    "device": {},
    "isInSandbox": true,
    "availableSurfaces": [
        {
            "capabilities": [
                {
                    "name": "actions.capability.AUDIO_OUTPUT"
                },
                {
                    "name": "actions.capability.SCREEN_OUTPUT"
                }
            ]
        }
    ]
}

0 个答案:

没有答案