[英]Google home device and dialogflow
我有一個代理,使用V1對話流程。 集成了兩個Google家用設備。
一台Google家用設備在歐洲,一台在印度。 兩台設備都配置了ccount。 使用同一帳戶來部署Webhook,部署和dialogflow代理。
固件版本相同。
該代理可以在模擬器上完美運行。
現在,當在Google主頁上進行交談時:
印度的Google設備:啟動inovkes時,會詢問一個特定的密碼,即使緩慢提及該密碼,對話框流JSON請求中也不會考慮空格。原始密碼沒有空格,例如密碼是12345,JSON請求是12345
歐洲的Google設備:啟動inovkes時,系統會要求您輸入特定的個人識別號,即使在提及緩慢的情況下,對話框流JSON請求中也會考慮空格。原始內容帶有空格並會被修剪。 假設密碼為12345,但JSON請求為123,
不知道為什么會這樣。
有什么幫助嗎?
添加對話框流程請求.........
來自印度Google Home Device的DF JSON請求傳至后端-工作正常
{
data: {
'timestamp': '2018-06-15T17:42:38.261Z',
'id': 'e5acf434-4e03-4c14-b3d9-e8fc98555694',
'status': {
'errorType': 'success', 'code': 200
}
,
'sessionId': '1529084528066',
'originalRequest': {
'source': 'google', 'data': {
'user': {
'userId': '1529084528066', 'locale': 'en-US'
}
,
'surface': {
'capabilities': [{'name': 'actions.capability.MEDIA_RESPONSE_AUDIO'}, {'name': 'actions.capability.AUDIO_OUTPUT'}]
}
,
'isInSandbox': True, 'inputs': [{
'arguments': [{
'name': 'text',
'rawText': 'my pin is 23456',
'textValue': 'my pin is 23456'
}],
'intent': 'actions.intent.TEXT',
'rawInputs': [{'inputType': 'VOICE', 'query': 'my pin is 23456'}]
}], 'conversation': {
'conversationId': '1529084528066',
'conversationToken': '["0748bff2-90d8-4941-8f9f-cf59dd3d009c_id_dialog_context","actions_capability_audio_output","actions_capability_media_response_audio","auth_dialog_context","auth_dialog_params_pin","defaultwelcomeintent-followup","google_assistant_input_type_voice"]',
'type': 'ACTIVE'
}
}
,
'version': '2'
}
,
'lang': 'en-us',
'result': {
'speech': '',
'action': 'DefaultWelcomeIntent.DefaultWelcomeIntent-custom',
'actionIncomplete': False,
'parameters': {
'phone': '1234567890', 'pin': '23456'
}
,
'fulfillment': {
'speech': '', 'messages': [{'speech': '', 'type': 0}]
}
,
'source': 'agent',
'contexts': [{
'name': 'google_assistant_input_type_voice',
'parameters': {
'phone': '1234567890',
'pin': '23456',
'pin.original': '23456',
'phone.original': '12345 67890'
},
'lifespan': 0
}, {
'name': 'actions_capability_audio_output',
'parameters': {
'phone': '1234567890',
'pin': '23456',
'pin.original': '23456',
'phone.original': '12345 67890'
},
'lifespan': 0
}, {
'name': 'auth',
'parameters': {
'phone': '1234567890',
'pin': '23456',
'pin.original': '23456',
'phone.original': '12345 67890'
},
'lifespan': 5
}, {
'name': 'defaultwelcomeintent-followup',
'parameters': {
'phone': '1234567890',
'pin': '23456',
'pin.original': '23456',
'phone.original': '12345 67890'
},
'lifespan': 1
}, {
'name': 'actions_capability_media_response_audio',
'parameters': {
'phone': '1234567890',
'pin': '23456',
'pin.original': '23456',
'phone.original': '12345 67890'
},
'lifespan': 0
}],
'resolvedQuery': 'my pin is 23456',
'score': 1.0,
'metadata': {
'matchedParameters': [{
'prompts': [{'value': 'Please tell us your pin', 'lang': 'en'}],
'required': True,
'name': 'pin',
'value': '$pin',
'dataType': '@sys.phone-number',
'isList': False
}],
'webhookUsed': 'true',
'intentId': '0748bff2-90d8-4941-8f9f-cf59dd3d009c',
'nluResponseTime': 296,
'intentName': 'auth',
'webhookForSlotFillingUsed': 'false',
'isResponseToSlotfilling': False
}
}
}
}
來自歐洲的Google Home Device的DF JSON請求將發送到后端-請參見密碼問題,
{
data: {
'timestamp': '2018-06-15T13:19:06.014Z',
'id': 'ca0ebb47-8bf1-478b-9c87-c704e0114cf9',
'status': {'errorType': 'success', 'code': 200},
'sessionId': '1529068715507',
'originalRequest': {
'source': 'google',
'data': {
'user': {'userId': '1529068715507', 'locale': 'en-US'},
'surface': {'capabilities': [{'name': 'actions.capability.AUDIO_OUTPUT'}, {'name': 'actions.capability.MEDIA_RESPONSE_AUDIO'}]},
'isInSandbox': True,
'inputs': [{
'arguments': [{
'name': 'text',
'rawText': 'my pin is 2 3 4 5 6',
'textValue': 'my pin is 2 3 4 5 6'
}],
'intent': 'actions.intent.TEXT',
'rawInputs': [{'inputType': 'VOICE', 'query': 'my pin is 2 3 4 5 6'}]
}],
'conversation': {
'conversationId': '1529068715507',
'conversationToken': '["0748bff2-90d8-4941-8f9f-cf59dd3d009c_id_dialog_context","actions_capability_audio_output","actions_capability_media_response_audio","auth_dialog_context","auth_dialog_params_pin","defaultwelcomeintent-followup","google_assistant_input_type_voice"]',
'type': 'ACTIVE'
}
},
'version': '2'
},
'lang': 'en-us',
'result': {
'speech': '',
'action': 'DefaultWelcomeIntent.DefaultWelcomeIntent-custom',
'actionIncomplete': False,
'parameters': {'phone': '1234567890', 'pin': '234'},
'fulfillment': {'speech': '', 'messages': [{'speech': '', 'type': 0}]},
'source': 'agent',
'contexts': [{
'name': 'google_assistant_input_type_voice',
'parameters': {
'phone': '1234567890',
'pin': '234',
'pin.original': '2 3 4',
'phone.original': '123-456-7890'
},
'lifespan': 0
}, {
'name': 'actions_capability_audio_output',
'parameters': {
'phone': '1234567890',
'pin': '234',
'pin.original': '2 3 4',
'phone.original': '123-456-7890'
},
'lifespan': 0
}, {
'name': 'auth',
'parameters': {
'phone': '1234567890',
'pin': '234',
'pin.original': '2 3 4',
'phone.original': '123-456-7890'
},
'lifespan': 5
}, {
'name': 'actions_capability_media_response_audio',
'parameters': {
'phone': '1234567890',
'pin': '234',
'pin.original': '2 3 4',
'phone.original': '123-456-7890'
},
'lifespan': 0
}, {
'name': 'defaultwelcomeintent-followup',
'parameters': {
'phone': '1234567890',
'pin': '234',
'pin.original': '2 3 4',
'phone.original': '123-456-7890'
},
'lifespan': 1
}],
'resolvedQuery': 'my pin is 2 3 4 5 6',
'score': 1.0,
'metadata': {
'matchedParameters': [{
'prompts': [{
'value': 'Please tell us your pin',
'lang': 'en'
}],
'required': True,
'name': 'pin',
'value': '$pin',
'dataType': '@sys.phone-number',
'isList': False
}],
'webhookUsed': 'true',
'intentId': '0748bff2-90d8-4941-8f9f-cf59dd3d009c',
'nluResponseTime': 356,
'intentName': 'auth',
'webhookForSlotFillingUsed': 'false',
'isResponseToSlotfilling': False
}
}
}
}
即使您的區域設置相同,您的位置也不同。 我猜想,這會影響@sys.phone-number
的解釋。
因此,如果您要使用其他dataType
(例如@sys.number-sequence
),我認為它會起作用。
您可以通過在Google Actions Simulator中更改位置來嘗試此操作。
(訓練不同的數字序列似乎可以改善結果 。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.