Alexa Content App with Media in Native Mode
(Audio, Video, & Images)
Objective:
This document will show you how to use the Content app that displays native video or image in Alexa.
Introduction to API:
The VoiceWorx platform can retrieve native content (Video, audio image) for consumption in an external device with capability to interpret and present this media type. To demonstrate this ability, we will upload a video content and define an Alexa skill intent that can be invoked to display this video.
Goal:
Our goal is to demonstrate the capability of the VoiceWorx platform to manage native content and respond to intent requests from devices that have the capability to display those content with appropriately formatted response data. We will create an Alexa Skill named Native Content. This skill will define a PlayVideo intent that retrieves and plays a video content stored/defined in the VoiceWorx platform.
Pre-requisites
An active AWS Account
You should have an active AWS Account. If you do not have it, you can create an AWS account at https://portal.aws.amazon.com/billing/signup#/start
AWS Accounts Include 12 Months of Free Tier Access
A VoiceWorx Account
For steps to create a VoiceWorx account, follow the steps at https://docs.voiceworx.ai/general/voiceworx-create-account
A Skill in the VoiceWorx account
You should have created a skill and should have at least one Utterance in it.
Access Key, Secret access key and AWS Region Name To be able to connect to Amazon Lex from the VoiceWorx platform, one IAM user is required and user should have the required permissions to access Lex service.
Following is a json document which you can use to create an IAM policy and assign it to the IAM user in the AWS console.
Steps:
The following shows the general steps/activities that will be carried out in setting up this integration. Note: It is advisable to use same email for signup across the 3 channels below. Step 1 -3 below are compulsory
Ensure you Login With Amazon (LWA) account is setup by your admin. If you are the account admin, you can follow this instruction to set it up.
Setup A DataSource
Upload Content in VoiceWorx
Create a custom skill in Voiceworx.
Publish the skill
Enable the skill in alexa.amazon.com
Test in Echo Show
Setup an Internal Content Data Source
Sign in to the VoiceWorx platform https://portal.voiceworx.ai/ and use navigation menu on left side. go to Integration Menu and select Connect System
And click “Connect External System” button
Select “Custom” as Integration Category, Select Internal “Content System Type”, select the System Instance Name to “Native Content Integration” and click “Connect System”
Internal Category: Custom
System Type: Internal Content
Service Instance Name: Native Content Integration
Upload Content in VoiceWorx Platform
Login into the VoiceWorx platform https://portal.voiceworx.ai/account/login, expand the “Content” menu on the left side and select “Content” then click “Content Categories”. Click on “Add New Category”.
Then enter or select the following:
Content Category: Native Video
Description Native Video
Click: Add
Return to the left navigation menu and select “Content” then select “Content”.
You can now create content in two ways:
Add New Content
Users can upload their own Html, SSML and media files to create contents.
Create Content from Template
Allows users to create a content using inbuilt Content Templates provided by VoiceWorx.
Click “Add New Content” button.
Perform the following activities to add new content.
Content Name: Native Video
Content Code: Native Video
Category: Native Content
Text: Native Content
Media: Check box and select the
Media Type: Video
Media Source: Upload File or Media URL. Select Media URL if you have a publicly accessible media source, else you can select a file on your machine. For demo purpose here, we are uploading file from local device.
Upload File: If you choose to Upload File, you shall be able to Upload File.
Media URL: If you select to provide Media URL, the URL that you provide here shall be publicly accessible. You can provide the following sample data if you want to create content using Media URL. (URL: https://demovideo.s3.amazonaws.com/demo_video.mp4)
Click: Fill details as shown below and click on Add.
Create Custom Skill in Voiceworx.ai
To create a custom skill in VoiceWorx click the left navigation menu and select “custom skills” then select “manage skills”. Click “Create New Custom Skill”.
Then enter or select the following:
Name: Native Content
Custom Skill Type: Search
Category: Native Video (This should be same as the Category of the Content).
Click: Save
In the top menu tabs, select “Data Sources” then “Create New Data Source”.
Then enter or select the following:
Name: Native Content DS
Integration Configuration: Internal Content: Native Content Integration
Click: Save
In the top menu tabs, click “Methods” then select “Create New Method”.
The Method has following parts:
Method Inputs
Method Output
Method Result
Result Options
Lex Options
Session Attributes
For this method, we are going to use Method Inputs, Method Result and Result Options.
Fill the following fields in Method Inputs tab.
Method Name: PlayVideo
Request Type: Content
Content Name: {{Video}}
Category Name: Native Video
Now in Method Result tab. Fill following information.
Empty Result Template: Requested video cannot be found. How else can I help you?
Result Template: Here is the requested video {{MediaUrl}}. How else can I help you?
Click: Save and Test
In the resulting test screen, type “native video” into the Video textbox. Note: “native video” is the name of the content we uploaded in the previous steps above. The test screen only proves and shows that the VoiceWorx platform can retrieve your uploaded content and construct the appropriate response to a requester.
Before moving to another step, let’s test whether the method is working fine or not. Click on the ‘Test’ button in the newly created method.
For Test purpose, you need to fill out the parameters. In our case, we have one parameter {{Video}} for ContentName. Fill the following details:
Video: Native Video (This name shall match with that of the content created in Step 17).
The next step is to create Intents. In the top menu tabs, click “Intents” and then click “Create New Intent”.
Then enter or select the following options:
Name: PlayVideo
Intent Type: Search
Datasource: Native Content DS
Method: PlayVideo
Now you want to create Slots. Slots correspond to the parameter that you want to use in your app. In the top menu tabs select “Slots” then select “Create New Slot”. Note the re-prompt message is what Alexa will ask if it can’t fill/resolve the video slot.
Then enter or select the following options:
Name: Video
Re-prompt Message: What is the video name
Type: Text
Custom Skill: Native Content
Intent: Play Video
Click: Save
After creating slots, now you have to create utterances. Utterances are words spoken to launch specific intents. In the top menu tabs select “Utterances” then select “Create New Utterance”.
Then enter or select the following options:
Value: Show me {Video}
Custom Skill: Native Content
Intent: PlayVideo
Click: Save
In the top menu tabs select “Input” then select “Create New Input”.
Then enter or select the following options:
Name: video
Description: (leave blank)
Custom Skill: Native Content
Custom Intent: PlayVideo
Data Source: Native Content DS
Data Source Method: PlayVideo
Click: Save
Publish to Alexa
Then enter or select the following options:
External Skill Name: This will be the name of the skill in Alexa. Therefore, make it unique and different from the names of your other skills in Alexa. In this case we named it “Native Content”.
Skill Type: Search
Channel: Alexa
Ensure the following are not checked: Require Account Linking & Auto Publish
External Skill ID: (This information will automatically drop in this field).
Skill Invocation: this will be what users say to launch your skill in Alexa. It must be in lower case alphabets cannot contain START, BEGIN, STOP, EXIT, LAUNCH and cannot contain number or special characters. For this step we used “native content test”.
Welcome Message: Welcome to Native Content Test. How can I help you?
Reprompt Message: You can say “play video, native video” or say “help” for more guidance. How else can I help you?
Help Message: You can ask me to play a video, by saying play video, native video. To exit native content, say exit.
Goodbye Message: Thank you for using native content, goodbye.
Fallback Message: I am sorry I didn’t understand that. How else can I help you?
Optional: Replace all placeholder values in all “Message”
Uncheck: Enable Address, Full Address, Region & Postal Code, etc. (Settings shown in the images below).
Click: Save
On the resulting screen click “Publish To Alexa”.
Select your login with Amazon profile then click “Publish To Alexa”.
Then enter or select the following options:
Selected Skill: Native Content
Select Amazon Account (LWA)
If you do not have an Amazon Account for LWA, click on the “Add Amazon Account for LWA” to set up. Select the LWA account setup by your admin and
Click: Publish To Alexa
On the resulting screen, ensure that a success message shows for the publishing steps before clicking “Go To Alexa Skill”. If success message does not appear, go back to Publishing to fix any issue shown in publishing result.
On the Alexa skill page, ensure “Full Build Successful” message appears in bottom right corner before starting to test skill.
Click on left navigation menu select “Slot Types” then click “Interfaces”.
Enable the “Video App” interface
Click “Save Interfaces” at the top of the page after enabling the Video APP interface.
At the top of the page click “test” tab and change the skill test status to from “Off” to “Development”
Now invoke the skill using skill invocation text. After successful invocation, call the skill.
Since this is a video skill, the developer console does not support this. Hence, you have to invoke the skill from device. You have to enable the skill to be able to invoke it from your device.
Enable Skill
Select “Skill” on left navugation menu, then select “All Skill”.
Select “Native Content” skill and click “Enable” button.
Echo Show Set Up
To setup your Echo Show follow this tutorial from Amazon.
To ensure that Echo Show language is set to English US.
Please select the following:
Slide down the top downward pointing arrow button in Echo Show
Click: Device Option
Select: Device Language
Ensure its on English (US)
Invoke the skill in Echo Show by Saying “Alexa open Native Content test”
Play video skill by saying “show me native video”.
Note: Native Video was the content name for the video we set up in step 18 above.
Congratulations! You have successfully completed building
Alexa Content Skill with Media in Native Mode.
Note: App and skill are interchangeably used in the document.
Last updated