我使用轮播(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"
}
]
}
]
}