简体   繁体   中英

Google home device and dialogflow

I have a agent, using V1 dialog flow. Integrated with two Google home devices.

One Google home device is in Europe, one in India. Both the devices are configured ccount. The same account is used to deploy the webhook, deploy and dialogflow agent.

The firmware version is identical.

The agent works perfectly on simulator.

Now when talked on Google home:

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 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. say pin is 12345 but JSON request is 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

{
  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,

{
  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 .

So if you would use another dataType (eg @sys.number-sequence ), I think it would work.
You could probably try this by changing your location in the Google Actions Simulator.
(Training diverse number sequences seems to improve the results .)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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