简体   繁体   English

Google家庭设备和dialogflow

[英]Google home device and dialogflow

I have a agent, using V1 dialog flow. 我有一个代理,使用V1对话流程。 Integrated with two Google home devices. 集成了两个Google家用设备。

One Google home device is in Europe, one in India. 一台Google家用设备在欧洲,一台在印度。 Both the devices are configured ccount. 两台设备都配置了ccount。 The same account is used to deploy the webhook, deploy and dialogflow agent. 使用同一帐户来部署Webhook,部署和dialogflow代理。

The firmware version is identical. 固件版本相同。

The agent works perfectly on simulator. 该代理可以在模拟器上完美运行。

Now when talked on Google home: 现在,当在Google主页上进行交谈时:

Google device in India: When started inovkes, there is a certain pin number which is asked, even when pin is mentioned slowly, spaces are not considered in the dialog flow JSON request pin.original is without spaces, say pin is 12345, JSON request is 12345 印度的Google设备:启动inovkes时,会询问一个特定的密码,即使缓慢提及该密码,对话框流JSON请求中也不会考虑空格。原始密码没有空格,例如密码是12345,JSON请求是12345

Google device in Europe: When started inovkes, there is a certain pin number which is asked, even when pin is mentioned slowly, spaces are considered in the dialog flow JSON request pin.original is with spaces and gets trimmed. 欧洲的Google设备:启动inovkes时,系统会要求您输入特定的个人识别号,即使在提及缓慢的情况下,对话框流JSON请求中也会考虑空格。原始内容带有空格并会被修剪。 say pin is 12345 but JSON request is 123, 假设密码为12345,但JSON请求为123,

Not sure why this is happening. 不知道为什么会这样。

Any help, please? 有什么帮助吗?

Adding the dialog flow requests......... 添加对话框流程请求.........

DF JSON Request coming to backend from Google Home Device in India - Working Fine 来自印度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
      }
    }
  }
}

DF JSON Request coming to backend from Google Home Device in Europe - See the pin number issue, 来自欧洲的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
      }
    }
  }
}

Even though your locale is the same, your location is different. 即使您的区域设置相同,您的位置也不同。 I guess, that this influences the interpretation of @sys.phone-number . 我猜想,这会影响@sys.phone-number的解释。

So if you would use another dataType (eg @sys.number-sequence ), I think it would work. 因此,如果您要使用其他dataType (例如@sys.number-sequence ),我认为它会起作用。
You could probably try this by changing your location in the Google Actions Simulator. 您可以通过在Google Actions Simulator中更改位置来尝试此操作。
(Training diverse number sequences seems to improve the results .) (训练不同的数字序列似乎可以改善结果 。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM