Botium Connector for Amazon Alexa Skills API
MIT License
This is a Botium connector for testing your Amazon Alexa Skills with the Skills Management API.
Did you read the Botium in a Nutshell articles ? Be warned, without prior knowledge of Botium you won't be able to properly use this library!
The Alexa Skills Management API enables Botium to talk to your Alexa skill.
It can be used as any other Botium connector with all Botium Stack components:
When using Botium CLI:
> npm install -g botium-cli
> npm install -g botium-connector-alexa-smapi
> botium-cli init
> botium-cli run
When using Botium Bindings:
> npm install -g botium-bindings
> npm install -g botium-connector-alexa-smapi
> botium-bindings init mocha
> npm install && npm run mocha
When using Botium Box:
Already integrated into Botium Box, no setup required
This connector includes a CLI wizard to initialize the botium.json file holding your connection credentials.
This wizard is part of Botium CLI as well.
> npx botium-connector-alexa-smapi-cli init
This wizard will guide you through the Botium Connector setup. Please follow the instructions. It involves Copy&Paste from a web browser to this terminal window.
Open the file botium.json in your working directory and add other settings if required.
{
"botium": {
"Capabilities": {
"PROJECTNAME": "<whatever>",
"CONTAINERMODE": "alexa-smapi",
"ALEXA_SMAPI_API": "invocation",
"ALEXA_SMAPI_SKILLID": "..."
}
}
}
Botium setup is ready, you can begin to write your BotiumScript files.
This connector provides a CLI interface for importing the Interaction Model from your skill and convert it to BotiumScript.
You can either run the CLI with botium-cli (it is integrated there), or directly from this connector (see samples/cli directory for some examples):
> npx botium-connector-alexa-smapi-cli import --interactionmodel entityresolutionquizdemo.json
Please note that a botium-core installation is required
For getting help on the available CLI options and switches, run:
> npx botium-connector-alexa-smapi-cli import --help
Set the CONTAINERMODE capability to alexa-smapi
default: "simulation"
Either "simulation" or "invocation" to use the respective Skill Management API
See the samples directory for configuration and conversation samples.
The Alexa Skill ID
default: "en-US"
The locale used for the simulation / invocation - list of valid locales see here
The long-living refresh token. Typically, the refresh token is created with the initialization wizard (see above).
default: "https://api.amazonalexa.com"
Skill Management API Url
From your Amazon Security Profile
Amazon vendor id
default: "default"
The AWS Endpoint the Skill is linked to (only required for Skill Invocation API) - see here
When using the Invocation API, tell Botium to use a special intent and a special slot to hand over the input text (intent resolution is done by Skill itself)
default: the file invocation-request-template.json in this repository
When using the Invocation API, tell Botium to use a special template for the invocation request (JSON formatted).
default: false
These will add Audio and Display capabilities when set to true to the invocation request sent to the Skill Management API.
default: false
This only works with the invocation API
This will generate a new userId to send within each different convo.txt file. By default the userId is botium-core-test-user
and when
generated the user will be botium-core-test-user-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
with a randomly generated UUID.
default: false
This only works with the invocation API
If your skill contains audio player responses this will track the changes to the audio player such as the token
and the playerActivity
and allow you to use intents such as AudioPlayer.PlaybackNearlyFinished
and other AudioPlayer
intents and get the state back on the response.
default: empty
This only works with the simulation API
Prepend this phrase to all user utterances