google-assistant-sdk

What does the map for SynonymType.entities look like?


I can't seem to figure out how to actually create a synonym for Google Assistant to map labels and label to label when answering a query.

Here's my type file:

synonym:
  # matchType: FUZZY_MATCH
  acceptUnknownValues: false
  entities:
    label:

Unfortunately, the value of intent.params.{fieldName}.resolved continues to map to labels (plural) when spoken as a plural phrase. The documentation doesn't specify what the map for entities should look like.

Documentation links:


Solution

  • Based on this example: https://github.com/actions-on-google/actions-builder-facts-about-google-nodejs/blob/master/sdk/custom/types/fact_category.yaml

    Google Assistant SDK SynonymType should look like this:

    synonym:
      entities:
        'resolved value':
          synonyms:
          - 'proposed match 1'
          - 'proposed match 2'
          - 'proposed match 3'
      matchType: EXACT_MATCH