Aura request semantic model v3

Version v3 of Aura request semantic model description

Introduction

The Aura Request Semantic Model defines the set of properties that can be included in the channelData property of the request activities sent from the Telefónica client side (channel) to the skills through aura-groot.

The properties of the Aura request semantic model corresponding to the v3 normalized version can be grouped into two categories:

Root channelData payload property

The payload property can be used by an external component to facilitate the sharing of information between the channels, aura-groot and the skills in order add extra information associated with the channel and, consequently, enrich the request.

The full content of channelData.payload will be sent from aura-groot to the skill, but the skill MUST send it back to aura-groot, without removing anything.

The skill can only add two fields, that are explained below: channel and skill:

  • channel is an optional open field, where the skill can share metadata with the channel. In Auraline, an external component can share metadata with the skill and/or get that information in the response.
  • skill is an optional but recommended field that must be fulfilled by the skill to inform aura-groot about the user’s intention recognized by the skill.

Currently, the payload property is used by components that interact with aura-groot through aura-bridge, but it could be used by any component. Moreover, this field is used in the interaction between aura-groot and skills.

The payload model is valid for every channel’s request-response version: v1, v2 and v3.

{
    "type": "message",
    "text": "Hello!",
    ...
    "channelData": {
        "payload": {
            // Extra channel information
        }
    }
}

Model definition

The complete model definition is located in the @telefonica/aura-utilities/lib/aura-models library (git repository: aura-models)

In the resources/channel-data folder of that repository, there is a scheme file with the definition in json schema format.

How to use the payload model

In order to use specific information from a channel (or communication that uses aura-bridge), certain steps are required:

  • Define the property name that will be sent in channeldata.payload.
  • Define the data model in aura-models.
  • Add/use the channelData.payload information in the different Aura components.

Model information

channelData payload information property can be used by an external component to aura-groot in order to send information for the enrichment of the request. The information sent does not correspond to the Bot Framework communication model, but it is used by aura-groot and certain dialogs to complete processing. Currently it is used by components interacting with the bot through aura-bridge, but it could is used by any component.

The following table and sections below shown the current parameters defined in the payload:

Property Type Description
bridge Bridge Information sent from aura-bridge
handover Handover Information sent from Handover
event PayloadEvent Information sent as an event
asyncCallback any Payload received in an async callback notification. The format is defined by the calling API. Only the dialog in charge of handling the request must validate the format
auraGroot AuraGrootPayLoad Information sent from aura-groot to the skill

Bridge

Object with relevant information sent from aura-bridge.

Property Type Description
accessToken string Bridge access token
answersCallback string URL to which the bridge will send the request back
channelId string ChannelId information
params any Open params
template Template Template information
user BridgeUser Information associated to the user who uses the bridge
whatsapp Whatsapp Information associated with the WhatsApp channel
resetGrootConversation Boolean Flag to indicate aura-groot that must create a new conversation with the skill
referral any Object that contains the whatsapp referral info
BridgeUser

Bridge user information

Property Type Description
name string Name associated with the user who makes the request to aura-bridge
BridgeUserName (Enum)

Enum for BridgeUserName

Property Type Description
System system Username used by aura-bridge
Template

Template information

Property Type Description
namespace string Namespace where the template is
name string Template’s name
language string Template’s language
parameters ParametersTemplate Template’s parameters
ParametersTemplate

ParametersTemplate information

Property Type Description
header string[] Parameters for header template
body string[] Parameters for body template
button CommandTemplate or string Parameters for buttons
CommandTemplate

CommandTemplate information

Property Type Description
intent string Intent associated to button
entities any[] Entities associated to button
WhatsApp

Options to configure the WhatsApp channel in aura-bridge.

Property Type Description
listOptions ListOptions It defines the conversion of prompts and suggestions that use HeroCard to WhatsApp lists.
allowEmpty boolean It indicates whether the texts of each of the messages received can be empty. By default: false
textConvert boolean It indicates whether the texts of each of the messages received must be converted to the WhatsApp markdown format. By default: true
ListOptions

It defines the conversion of prompts and suggestions that use HeroCard to WhatsApp lists.

Property Type Description
type ListOptionsType Whatsapp list type
rules ListOptionsRule Conversion rules to whatsapp lists
ListOptionsType (Enum)

Enum for ListOptionsType

Property Type Description
Button button Reply Buttons. Messages including up to 3 options
EnumeratedList enumeratedList Enumerated text list
List list List Messages. Messages including a menu of up to 10 options
ListOptionsRule

Conversion rules to WhatsApp lists

Property Type Description
type ListOptionsType WhatsApp list type
resources Resource Definition of resources used in the WhatsApp lists
Resource

Definition of the resources used in the WhatsApp lists

Property Type Description
name string Resource name
resourceKey string Resource key (POEditor)

Handover

Object with relevant information sent from the Handover

Property Type Description
agentName string Handover agent name
participantType string Type of participant associated with the event. Example: system, agent
eventType string Event type. Example: participantJoined, participantLeft
chatEnded boolean It indicates whether the chat with the user has ended
quitReasonCode number If the chat has ended, this field indicates the closing reason
reasonForLeave string Reason associated with the ParticipantLeft event (eventType)
genesysCallback string Handover URL to which aura-bot must send calls

PayloadEvent

Payload received in an async callback notification

Property Type Description
message string Message associated with event
status number Status associated with event
type TypeEvent Event type
TypeEvent (Enum)

Enum for TypeEvent

Property Type Description
Log log Log event
EmptyResponse emptyResponse Direct Line empty response event (Event sent by aura-bot when no response activity is sent)

AuraGrootPayLoad

Information sent from aura-groot to the skill. It is intended to facilitate the handling of activities by a skill. This field is only sent to the skill.

Property Type Description
channelConversationId string ID of the directlineConversation handled by the channel
channelId string Identifier of the channel in Aura
accountNumber string AccountNumber from user received in aura-groot
conversationHistory ConversationHistory Conversation history of user
ConversationHistory

Information sent from aura-groot to the skill regarding the conversation history of the user.

Property Type Description
date Date Date of message
id string Id of message
type ConversationHistoryType Type of message
from string From of message
message string Message
intentResult string Intent result
ConversationHistoryType (Enum)
Property Type Description
Request request Request type
Response response Response type

Payload examples

A complete example of the payload can found here.

Moreover, the example below shows the application of the auraGroot property:

{
    "locale": "en-EN",
    "type": "message",
    "from": {
        "id": "user1"
    },
    "text": "hello",
    "channelData": {
       "appContext": {
           "channel": {
               "id": "ca3f344f-b780-ef52-3c47-81daf07bb3d3",
               "modality": "text"
            }
            "timestamp": "2023-03-01T10:15:30+01:00",
            "timezone": "Europe/Madrid",
            "payload":
                "auraGroot": {
                    "channelConversationId": "<channelConversationId>", // id of the directlineConversation handled by the channel
                    "channelId": "<channelId>", // identifier of the channel in Aura
                }
            }
        },
       "version": "3",
       "correlator": "19d63cd4-8f7e-4194-837d-c55991b1afcd"
    }
}