Google Actions
Published in

Google Actions

They have been using a set of “trigger phrases” used to match user’s queries only when the user is in the middle of a dialog.

source: actionPreviews.create.__doc__Creates an Action Preview. Given a timeout and an Action Package w/o action_package_id provided, we assign a UUID for the action_package_id, insert it into the Action Package and return the Action Preview object.

Args:
body: object, The request body. (required)
The object takes the form of:

{ # The main entry point for developer's submission.
"actionPackageId": "A String", # Unique ID for this Action Package, developer invokes GetActionPackageID to
# request this ID.
"applicationInfo": { # Global application info for this agent. # Metadata for the application, like app name, ACL.
"voiceName": "A String", # Used to define voice type for current application. Must be set for 3p
# developers.
"appName": "A String", # The unique App name for the Application, developer submits an gets approval
# from Pantheon front-end, the name can't include space, e.g., "com.uber".
"voiceType": "A String", # Used to define voice type for current application. Must be set for 3p
# actions.
"displayName": "A String", # Developer friendly name for this agent.
},
"customType": [ # Developer defined custom types, e.g., Uber type from uber.
{ # Tye defined by Developer such as list of colors, or list of uber types.
"isDynamicDefined": True or False, # Indicates the type is runtime defined. Prefer is_user_defined instead. This
# field will be deprecated.
"name": "A String", # Name of the custom type, in the format of "$Type".
"isUserDefined": True or False, # Whether the values are user-defined (different for every user).
"entityCategory": "A String", # Semantic built-in type that is a hypernym of the entity type. Must be a
# built-in type.
"items": [ # List of items for this type. Each includes a key and list of synonyms.
{ # Each Item corresponds a unique entity for this type, it has a unique key
# and list of synonyms which are used to trigger.
"synonyms": [ # List of synonyms which can be used to refer to this item.
"A String",
],
"key": "A String", # Unique key for this item.
},
],
},
],
"action": [ # Each AP has list of actions, each could be an one-shot action, or a
# multiturn conversation.
{ # Action is an instance for a single-shot action or a multi-turn action.
"initialTrigger": { # Trigger indicates whether it's initial trigger or follow-on trigger. # Trigger phrases to activate developer's backend when user is not in any
# dialog, e.g., [OK Google, book a cab].
"intent": "A String", # Intent captured by the grammar match, e.g., BOOK_A_CAB.
"example": [ # List of trigger query pattern.
{ # Example captures an instance of annotated query example.
"queryPattern": "A String", # Grammar pattern developer requests, in the form of [token|Type:name]+ such
# as "book a cab to $SchemaOrg_Location:destination".
},
],
},
"language": "A String",
"description": "A String", # Describes what the action is doing.
"signInRequired": True or False, # Indicates whether to require user to sign-in before using the feature. This
# is set to true by default for APs requiring account linking such as Uber.
"inDialogTrigger": [ # Trigger phrases used to match user's queries only when user is in the
# middle of a dialog, e.g., [take me to $SchemaOrg_Location:dest].
{ # Trigger indicates whether it's initial trigger or follow-on trigger.
"intent": "A String", # Intent captured by the grammar match, e.g., BOOK_A_CAB.
"example": [ # List of trigger query pattern.
{ # Example captures an instance of annotated query example.
"queryPattern": "A String", # Grammar pattern developer requests, in the form of [token|Type:name]+ such
# as "book a cab to $SchemaOrg_Location:destination". },
],
},
],
"execution": { # Execution indicates how to execute the Action, as of Nov 2016, only HTTP is # Indicates the cloud endpoint which manages the actual dialog.
# allowed.
"httpMethod": "A String", # The HTTP method to execute the HTTP endpoint.
"url": "A String", # Cloud endpoint, could be Google Cloud Function or self-hosting endpoint.
},
},
],
}

timeoutInMins: string, How long developer wants to make this preview valid. If unspecified, a
default timeout 10 mins will be used.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format

Returns:
An object of the form:

{ # Action Preview is the mechanism for developer to start a tial on Gooogle
# Assistant even before the agent is registered or approved.
"createTime": "A String", # Creation time of an Action Preview.
"expireTime": "A String", # Expiration time of an Action Preview, it will be removed automatically.
"actionPackage": { # The main entry point for developer's submission. # The actual Action Package developer wants to preview. When she creates the
# preview, initially she does not have the action_package_id which will be
# assigned in CreateActionPreview request.
"actionPackageId": "A String", # Unique ID for this Action Package, developer invokes GetActionPackageID to
# request this ID.
"applicationInfo": { # Global application info for this agent. # Metadata for the application, like app name, ACL.
"voiceName": "A String", # Used to define voice type for current application. Must be set for 3p
# developers.
"appName": "A String", # The unique App name for the Application, developer submits an gets approval
# from Pantheon front-end, the name can't include space, e.g., "com.uber".
"voiceType": "A String", # Used to define voice type for current application. Must be set for 3p
# actions.
"displayName": "A String", # Developer friendly name for this agent.
},
"customType": [ # Developer defined custom types, e.g., Uber type from uber.
{ # Tye defined by Developer such as list of colors, or list of uber types.
"isDynamicDefined": True or False, # Indicates the type is runtime defined. Prefer is_user_defined instead. This
# field will be deprecated.
"name": "A String", # Name of the custom type, in the format of "$Type".
"isUserDefined": True or False, # Whether the values are user-defined (different for every user).
"entityCategory": "A String", # Semantic built-in type that is a hypernym of the entity type. Must be a
# built-in type.
"items": [ # List of items for this type. Each includes a key and list of synonyms.
{ # Each Item corresponds a unique entity for this type, it has a unique key
# and list of synonyms which are used to trigger.
"synonyms": [ # List of synonyms which can be used to refer to this item.
"A String",
],
"key": "A String", # Unique key for this item.
},
],
},
],
"action": [ # Each AP has list of actions, each could be an one-shot action, or a
# multiturn conversation.
{ # Action is an instance for a single-shot action or a multi-turn action.
"initialTrigger": { # Trigger indicates whether it's initial trigger or follow-on trigger. # Trigger phrases to activate developer's backend when user is not in any
# dialog, e.g., [OK Google, book a cab].
"intent": "A String", # Intent captured by the grammar match, e.g., BOOK_A_CAB.
"example": [ # List of trigger query pattern.
{ # Example captures an instance of annotated query example.
"queryPattern": "A String", # Grammar pattern developer requests, in the form of [token|Type:name]+ such
# as "book a cab to $SchemaOrg_Location:destination".
},
],
},
"language": "A String",
"description": "A String", # Describes what the action is doing.
"signInRequired": True or False, # Indicates whether to require user to sign-in before using the feature. This
# is set to true by default for APs requiring account linking such as Uber.
"inDialogTrigger": [ # Trigger phrases used to match user's queries only when user is in the
# middle of a dialog, e.g., [take me to $SchemaOrg_Location:dest].
{ # Trigger indicates whether it's initial trigger or follow-on trigger.
"intent": "A String", # Intent captured by the grammar match, e.g., BOOK_A_CAB.
"example": [ # List of trigger query pattern.
{ # Example captures an instance of annotated query example.
"queryPattern": "A String", # Grammar pattern developer requests, in the form of [token|Type:name]+ such
# as "book a cab to $SchemaOrg_Location:destination".
},
],
},
],
"execution": { # Execution indicates how to execute the Action, as of Nov 2016, only HTTP is # Indicates the cloud endpoint which manages the actual dialog.
# allowed.
"httpMethod": "A String", # The HTTP method to execute the HTTP endpoint.
"url": "A String", # Cloud endpoint, could be Google Cloud Function or self-hosting endpoint.
},
},
],
},
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Google Assistant Developer

Google Assistant Developer

Discussing Google Actions and Virtual Assistants