Adding the Amazon Alexa Channel¶
The Kore.ai XO Platform supports the integration of Virtual Assistants (VA) into the Amazon Alexa Channel. Ensure you have an Amazon Developer account for this configuration. Additionally, Amazon Alexa should be enabled for VAs built for voice-based channels.
To accomplish the channel enablement, you must do the following:
- First, update the JSON file with the supported bot tasks from the Kore.ai XO Platform to the Alexa Developer Portal.
- Next, configure the Webhook URL from the Kore.ai XO Platform as the Service Endpoint on the Alexa Developer Portal to receive messages.
Important Checks and Considerations¶
The following are the important checks to do and considerations before you enable the Amazon Alexa channel:
- Enterprise assistants that require the user’s authorization to communicate with it are not supported.
- If your dialog tasks require the user’s authorization to communicate with external systems, then the Platform will push a card with URL information to the Alexa app.
- Intents and entities of only Published Dialog Tasks can be exported to Amazon Alexa.
- Ensure that your intents and entities adhere to the naming guidelines of Amazon Alexa.
- Not all entity types available in the Kore.ai Platform are available in Alexa. Verify that your tasks contain Alexa-supported entities for optimal user experience.
- Ensure that your dialog tasks contain one or more utterances.
- To display responses as templates on supported devices like Echo Show, you must define channel-specific responses/prompts.
- Ensure that your dialog tasks contain only the Message node as the last node. Alexa marks a task as completed if a VA message is displayed without expecting input from the user.
- Webhook Nodes work asynchronously and are currently not supported.
- Amazon Alexa executes one task at a time, so the Hold & Resume functionality is not supported.
Configuration Overview¶
The steps to add the Amazon Alexa channel are given below:
- Add a New Skill – Create a new Alexa skill in the Amazon developer console.
- Configure the Interaction Model – The Alexa skill can be built in one of the following ways:
- Dialog Migration to extract the dialog tasks from Kore.ai and import them into Amazon Alexa’s Skills. This will entail reimport for reflecting the ongoing changes in the dialog definition. Intent detection and execution are primarily controlled by Alexa.
- Redirection to create a single intent in your skill with the SearchQuery Slot Type that accepts user inputs and redirects them to your Kore.ai VA. Intent detection and execution are primarily controlled by the Kore.ai VA.
- Enable Account Linking (Optional) – To access end user’s authentication details to make API calls to external services.
- Enable Webhook Integration – To integrate Amazon Alexa with your Kore.ai VA, enable webhook integration by copying the Webhook URL on the Configurations tab of the Amazon Alexa Channel page in the XO Platform and select HTTPS as the Service Endpoint type.
- Enable Channel – Enable the channel after completing the integration setup.
- Test Integration – Once the channel is enabled, test any intent utterance using the Test tab of your Alexa Skill to validate a successful integration and check its responses for the given test utterances.
- Distribution, Privacy & Compliance, and Certification – Publish your Alexa Skill on Alexa App and provide details for Privacy and Compliance to enable Skills Beta Testing, which allows you to invite your co-developers to test your app. You must also submit your Skill to Amazon for certification to enable your skill to become visible on Alexa Skills on Amazon App Store after it is certified.
Step 1: Add a New Skill¶
- Log in to your Amazon Developer Dashboard and click the Alexa tab.
- Select Alexa Skills Kit on the menu.
- Click the Skills tab on the Alexa Developer Console.
- Click Create Skill.
- Enter the Skill Name field information on the Create a New Skill page and select the primary locale value.
- Then, follow the steps below:
- Enable the Sync Locale option, if required.
- Select Custom (default selection) to Choose a model to add to your skill to create all of your skill’s interactions and map them to your custom model.
- Under Choose a method to host your skill’s backend resources section, select Alexa-hosted(Node.js).
- Click Create Skill.
- Select a template to add to your skill with these steps:
- Select the Start from Scratch tab.
- Click Continue with Template.
- Enter the captcha shown on the screen and click Submit to process and create an Amazon Alexa voice skill. Your skill is built and listed on the Developer Console.
- Click Your Skills to view the custom skill you added to the console.
Step 2: Configure the Interaction Model¶
Configuring the Interaction Model helps define the words and phrases in the user utterances on the Alexa channel to configure the virtual assistant skill accordingly. An Interaction Model lets you add intents and annotations and check the Intent History and Utterance Conflicts. Learn more.
Dialog Migration to Extract the Dialog Tasks from Kore.ai¶
To configure a custom Interaction Model, follow the steps below:
- On the Developer Console, select the Build tab. Then, click the Interaction Model left menu option.
- Select the JSON Editor option.
- In the JSON Editor window, define the intents and entities to associate with your newly created skill based on the Kore.ai XO Platform definitions.
- To capture the intents and entities from the Kore.ai XO Builder, follow these steps:
- Select the virtual assistant.
- Navigate to Channels & Flows > Channels > Third Party Voice > All > Amazon Alexa > Configurations.
-
Click Download File under Alexa Skill Definition JSON to download the VA’s tasks.
-
Click Confirm on the Download window.
- Click Drag and drop a .json file on the JSON Editor of the Alexa Developer Console and upload the file.
- The JSON Editor gets updated with the information in the uploaded file.
- Click Evaluate Model to review and ensure that there are no errors.
- Click Save Model, then click Build Model.
Note
It takes 2-5 mins for the Model to build. Any changes to the built model can be implemented by rebuilding the model.
Create a Single Intent with the SearchQuery Slot Type¶
The AMAZON.SearchQuery
slot type helps capture less-predictable user utterances in the search query for an intent name. Once you configure the SearchQuery Slot Type, the Alexa Channel redirects the utterances to your Kore.ai Virtual Assistant for intent detection.
Tip
Please ensure that your skill uses at most one AMAZON.SearchQuery
slot per intent. The Amazon.SearchQuery
slot type cannot be combined with another intent slot in sample utterances.
To configure a custom Interaction Model for the SearchQuery Slot Type, follow the steps below:
- Follow the sequence in Step 4 of Dialog Migration to Extract the Dialog Tasks from Kore.ai.
- Create a new custom intent by following these steps.
- After writing a few utterances, pick the words or phrases representing variable information as the intent’s slots; For example, “I would like to order two iPhones.”
- Create a slot for each word or phrase and replace the original word with the slot name in curly brackets ({ }).
- To create a slot, follow the steps below:
- Sign in to the Alexa Developer Console.
- Click the Skills tab.
- In the SKILL NAME column, click the name of your custom skill.
- From the left menu, click Custom > Interaction Model > Intents.
- Click +Add Intent to create a custom intent.
- Type a Custom Intent Name and click Create custom Intent.
- Click this intent name listed on the left menu under Intents to open the detail page.
- Add the phrases or words in the Sample Utterances text input field.
- In the drop-down box, enter the slot name and click the + icon.
- Repeat these steps for all the remaining variable words.
- Select
AMAZON.SearchQuery
from the dropdown list in the SLOT TYPE column. - Click Save Model and Build Model on the top action panel.
Note
On the Intents detail page, the Intent Slots section displays the slots you add. When you highlight a word or phrase in an utterance, you can add a new slot or select an existing slot.
Step 3: Enable Account Linking (Optional)¶
If end-user authorization is required for making API calls to external services, you need to enable the Account Linking feature for your Alexa Skill with the steps below:
- On Your Skills console, select the Build tab.
- Expand the Tools left menu, then click Account Linking.
- Auth Code Grant is the default Authorization grant type selection on the Account Linking page.Enter the values for the mandatory fields under Security Provider Information. Learn more.
- Click Save to configure the Implicit Grant flow for Account Linking.
Alexa shares the user access tokens with Kore.ai assistants to make API calls defined for the Service nodes.
Tip
Please enable Account Linking on the Kore.ai Platform under Configurations in the Amazon Alexa window. This allows Kore.ai assistants to use the access tokens from Alexa to make API calls defined in the Service nodes.
Step 4: Enable the Webhook Integration¶
- On the Alexa Developer Console, click the Build tab on the top panel.
- Click the Endpoint left menu option.
-
On the Kore.ai XO Platform, copy the Webhook URL available under Configurations on the Amazon Alexa Channel window.
-
Paste the URL for the Default Region field on the Service Endpoint Type page.
-
For the Select SSL Certificate Type drop-down, select the option “My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority.”
-
Click the Save Endpoint button on the top panel.
The webhook/callback URL is configured successfully to receive messages and events.
Step 5: Enable the Channel¶
Before testing your assistant on Alexa, complete the channel setup with these steps:
- Click the Configurations in the Amazon Alexa window on the Kore.ai XO Platform.
- Select Yes for Enable Channel.
- Click Save to complete the configuration.
Step 6: Test the Integration¶
Once done, test the utterance integration on the Alexa Developer Console using the steps below:
- Click the Test tab.
-
Select Development for the Skill testing is enabled in option.
-
Navigate to the Alexa Simulator section, type an intent utterance, and click enter.
If you get a successful response, then the integration is considered a success.
Step 7: Distribution¶
To publish your Alexa Skill on the Alexa App, follow the steps below:
- Click the Distribution tab on the Alexa Developer Console.
- Click Skill Preview.
- Enter the values for the required fields.
- Click Save and Continue.
Privacy & Compliance¶
On Alexa, it’s important to set up your Privacy and Compliance information before building the model. To update Privacy and Compliance information, follow these steps:
- Click the Distribution tab. Then, click the Privacy & Compliance left menu option.
- Provide all the required details.
- Click Save and Continue.
Availability¶
You will be redirected to the Availability page to invite your co-developers to test your app. To complete the invitation, follow the steps below:
Validation¶
The next step is to validate your skills for the model. After configuring Availability, you will be redirected to the Validation page under the Certification section. Here, follow these steps:
- Review and complete any required fixes based on the details displayed for the issue.
-
Upon successful validation, your skill will be visible under Alexa Skills on Amazon App Store.
-
Additionally, your Skill Builder Checklist will display green checks for all the options.
- After enabling the channel and verifying all the configurations, you can test the new channel integration by publishing your virtual assistant. Learn more.
To learn more about working with messaging channels within the Kore.ai XO Platform, please see Channel Enablement.