Skip to content

Alexa

DialoX bots can be used to power Custom Skills on the Amazon Alexa range of devices.

Installation

To hook your DialoX bot to an Alexa skill, you need to do the following things in the Alexa developer console:

  1. Go to Build → Endpoint, select HTTPS as Service Endpoint Type, and set the endpoint URL for the default region to the value that can be seen on the "Alexa settings" page in DialoX. The URL looks like this:

https://bsqd.me/alexa/webhook/...

  1. Go to Build → Interaction Model → JSON Editor, paste the JSON code for the interaction model as can be found on the studio's Alexa settings page.

  2. Go to Invocation and change the default skill invocation.

  3. Click Save Model, and, after the saving is done, Build Model. Wait a bit while Alexa is training the interaction model.

  4. When the training is done, go to Test in the main menu and start interacting with your bot!

Runtime behaviour

Conversational exits

If Alexa catches a word like "stop" or "please shut up", or any other message that indicates that the user wants to exit the skill, the $stop event is sent to the DialoX bot. You can respond with a short message but must make sure that your bot indeed stops talking afterwards:

dialog event: "$stop" do
  say "Alright, see you next time."
  stop
end

"Deep linking" into your skill - the trigger query

It is possible to launch your skill by saying something like: "Alexa, ask my action about the weather". In this case, your skill is invoked with the main dialog, but the variable query.trigger is filled with the part of the prompt after about, in this case, it will contain "the weather".

dialog main when query.trigger do
  say "Welcome to your action."

  # dispatch the query internally to the intent matcher
  invoke message: query.trigger
end

dialog trigger: "weather" do
  say "So you want to talk about the weather..."
end