Categories:
mocks-v3 dialog
Description of the mocks-v3 dialog, responsible for handling mocked responses in use cases
Introduction to the mocks-v3 dialog
The mocks-v3 dialog is a new dialog that returns mocked responses of use cases to be used by developers.
These responses are returned in channelData V3 format.
Find here the source code of the dialog’s file mocks-dialog.ts.
How it works
The mocks-v3 dialog gets a mocked response from a blob in Azure Storage, it formats the response in a message with a channelData in version v3 and send it to the user. This mocked responses are part of the library resources and are uploaded to Azure Blob Storage during the make-up process, but new ones could be uploaded directly to Azure Blob Storage and will be returned by the dialog.
The mocks-v3 dialog updates the mock files cache if it is older than 2 minutes (or the configured value in MOCKSV3_ACCESS_AZURE_CONTAINER_TIMEOUT_MS environment variable).
These mocked files are stored in the static-resources container of Aura’s Azure Storage instance of the deployment, within the path:
libraries/mocks/${channelPrefix}/${intent}
The files will have the entities values, alphabetically sorted and joined with - as filename.
For example, if the mocked response has these values:
{
"intent": "intent.tv.search",
"entities": [
{
"entity": "temporada 3",
"type": "ent.audiovisual_tv_season_number",
"score": 0.0,
"start_index": 29,
"end_index": 41,
"canon": "3 temporada",
"label": null
},
{
"entity": "episodio 1",
"type": "ent.audiovisual_tv_episode_number",
"score": 0.0,
"start_index": 16,
"end_index": 28,
"canon": "1 capítulo",
"label": null
}
]
}
Then, the name of the file will be episodio_1-temporada_3.json and if the channel is set-top-box the complete route will be:
static-resources/libraries/mocks/stb/intent.tv.search/episodio_1-temporada_3.json
With these names, the mock will match the recognized intents and entities to find the correct mocked response to be returned.
Currently configured responses
The next table shows current responses configured in the mocks-v3 dialog:
| Intent | Entity | Aura Command | Phrase | Response |
|---|---|---|---|---|
intent.tv.search |
La Resistencia | "auraCommand": { "type": "suggestion", "value": { "intent": "intent.tv.search","entities": [{ "entity": "La Resistencia", "type": "ent.audiovisual_tvshow_title", "canon": "La Resistencia", "score": 1 }]}} |
Busca La Resistencia | Tv search with 0 results |
intent.tv.search |
fútbol | "auraCommand": { "type": "suggestion", "value": { "intent": "intent.tv.search", "entities": [{ "entity": "fútbol","type": "ent.audiovisual_sports", "canon": "fútbol", "score": 1 }]}} |
Busca fútbol | Tv search with 1 result (catalog_type=LIVE and content_type=live_episode) |
intent.tv.search |
Virtual Hero | "auraCommand": { "type": "suggestion", "value": { "intent": "intent.tv.search", "entities": [ { "entity": "Virtual Hero", "type": "ent.audiovisual_tvseries_title", "canon": "Virtual Hero", "score": 1 }]}} |
Busca Virtual Hero | Tv search with multiple results |
intent.tv.search |
Star Wars | "auraCommand": { "type": "suggestion", "value": { "intent": "intent.tv.search", "entities": [{ "entity": "Star Wars", "type": "ent.audiovisual_film_title", "canon": "Star Wars","score": 1 }]}} |
Búscame Star Wars | tv.search with multiple third party results |
intent.tv.search |
Closer | "auraCommand": { "type": "suggestion", "value": { "intent": "intent.tv.search", "entities": [{ "entity": "Closer", "type": "ent.audiovisual_film_title", "canon": "Closer", "score": 1 }]}} |
Búscame Closer | tv.search with third party result |
intent.tv.display |
Star Wars | "auraCommand": { "type": "suggestion", "value": { "intent": "auraCommand", "entities": [{ "entity": "star wars", "type": "ent.audiovisual_film_title", "canon": "Star Wars", "score": 1 }]}} |
Pon Star Wars | tv.display with CONTENT.PLAY action and third party result |
intent.tv.display |
La princesa prometida | "auraCommand": { "type": "suggestion", "value": { "intent": "intent.tv.display", "entities": [{ "entity": "La princesa prometida", "type": "ent.audiovisual_film_title", "canon": "La princesa prometida"," score": 1 }]}} |
Pon La princesa prometida | tv.display with CONTENT.PLAY action |
intent.tv.display |
Telecinco | "auraCommand": {"type": "suggestion", "value": {"intent": "intent.tv.display","entities": [ {"entity": "telecinco","type": "ent.audiovisual_channel","canon": "Telecinco","score": 1}] }} |
Pon Telecinco | tv.display with CHANNEL.PLAY action |
Environment variables
| Name | Default value | Description |
|---|---|---|
| MOCKSV3_ACCESS_AZURE_CONTAINER_TIMEOUT_MS | 120000 | Time to refresh Azure blob storage files cache |
| AURA_RESOURCES_PREFIX | libraries | Base folder in static-resources where dialog files are stored |
Dates and country codes
-
⚠️ Dates
Date fields likestart,end,release_dateandexpiration_dateshould be formatted toISO-8601 UTCaccording to Kernel documentation.
Currently, in Kernel response,startandenddo not match the format and these fields are modified in mock responses manually. -
⚠️ Country codes
Country fields likeoriginal_language_code,audiosandsubtiltesshould follow theISO 639-2format, but currently, none of these fields follow this standard in Kernel responses. Therefore, these fields are modified in mock responses to follow the standard.
default_language_orderis not present in current mock responses but should be a combination between twoISO 639-1country codes.