The interaction model of a card ability is classified into the user intent,event trigger andresident event. A user intent is a goal or a task that a user would like to achieve, for example, taking a taxi or checking the weather forecast. An event trigger functions by triggering an ability based on time and location, to satisfy the user intent.Permanent intent cards are applicable to HUAWEI Assistant of Huawei phones. If you need a permanent intent card, just create it, with no need to push events.
A user intent is represented by one or more intents in the interaction model. The intent is the input of user request implementation, and the intent includes the following information:
Intent identifier. An intent name under the same ability must be unique. Intent names are carried during ability fulfillment.
Category to which an ability belongs.
Mode in which a user interacts with an ability. The options are as follows:
Keyword
An ability is triggered when a user's intent, expressed through texts entered (keywords), matches the ability's definition. For example, a user searches for encyclopedia by entering the word on HiBoard. A user may search for an ability by specifying keywords in the search bar or by identifying keywords with HiTouch, which is triggered by pressing on the selected text with two fingers. Based on the keywords, Huawei finds out the applicable search card template and sends the complete keyword string to the card. During initiation, the card then passes the keywords to the developer's server, which will query and match content and return the found content back for rendering. The method for obtaining the user query statement from the card is this.hag_searchParam.
Voice
An ability is triggered when a user's intent, expressed by voice (keywords), matches the ability's definition. For example, a user checks the weather forecast through HiVoice.
Image
An ability is triggered when a user's intent, expressed through photos taken by camera, matches the ability. For example, a user uses HiTouch to search for the name of a flower. A user may search for an ability by scanning images or QR codes through AI Lens. During search, Huawei parses the images and QR codes, identifies user intents and search keywords, finds out the applicable ability and card template, and sends the image stream and keywords (optional) to the card. During initiation, the card then passes the image stream and keywords (optional) to the developer's server, which will query and match content and return the found content back for rendering. The method for obtaining the image stream during card initiation is this.imgDataand that for obtaining the search keywords is this.hag_searchParam(optional).
Select an appropriate trigger mode based on the interaction mode provided by an ability.
Interaction Mode | Trigger Mode |
|---|---|
A user can use an ability by entering a keyword, for example, today's weather. | Keyword |
A user uses an ability by voice, for example, the user asks "What's the weather like today?" | Voice |
A user uses an ability through images, for example, using an image of a car to identify the brand of the car. | Image |
Concept
An ability is triggered when event conditions (such as time and location) that you have set are met. When an event occurs, HUAWEI Ability Gallery pushes the ability card to users to display event-related information. To add an event, select an event category (Custom eventorPreset event), set the event type, name, description, specify whether to push an event to a specified user, set the duration when the event card will stay visible on the screen, and finally set the display mode.
Events fall into two categories: custom events and preset events, each of which contains three types.
(1) Custom Event
To add a custom event, you can set its name, trigger rules, and stay duration as needed. The event will then be pushed as configured. Custom events are classified into three types: User reminder, Service entry, and Content recommendation. You can configure one card that you have uploaded for each event to display event-related information. Up to 20 User reminder events are allowed; for Service entry and Content recommendation, the upper limit is 10.
① User reminder event
② Service entry event
③ Content recommendation event
The name of a preset event has a fixed prefix, and its trigger rules and stay duration are also fixed. The event will be pushed as preset. Preset events are classified into three types: Account binding guide, Service setting, and Service introduction. At most one preset event can be configured for each type. You can configure one card that you have uploaded for each event to display event-related information. The stay duration has a fixed value of 336 hours.
(1) Account binding card
(2) Service setting card
(3) Service introduction card
The event name must be carried when your server pushes an event to HUAWEI Ability Gallery. The event name must be unique under the same app ID.
If you select Yes, the event will be pushed to a specified user with an account bound; if you select No, the event will be pushed to all users.
This field indicates the duration in which an event card will stay visible on the screen, which is calculated from the event start time.
The event start time is carried in the event notification. If it is not carried in the notification, the stay duration is calculated immediately after the notification is received.
This field is mandatory, with a fixed value Custom card. Select a card that you have uploaded to display event-related information.
resident event cards are applicable to HUAWEI Assistant of Huawei phones. If you need a permanent intent card, just create it, with no need to push events. The card will be always available in HUAWEI Assistant. It is able to redirect user to your app such as a hotel booking app, or recommend quality content to users, such as hot recipes.