Building Alexa Skills with IBM Watson and OpenWhisk

I’ve open sourced a sample that shows how to build Alexa skills via the serverless framework OpenWhisk and IBM Watson Conversation. The sample demonstrates how to define a conversation flow declaratively via Watson Conversation dialogs and it shows how to pass context between different intents.

Here is a sample conversation flow:

  • User: Alexa, ask my skill what do you know about me
  • Alexa/Watson: I don’t know anything about you. Where do you live?
  • User: Berlin
  • Alexa/Watson: Now I know you live in Berlin
  • User: Alexa, ask my skill how is the weather
  • Alexa/Watson: Looking up weather information for Berlin …

The sample has been implemented via the new slots filling functionality in Watson Conversation. The screenshot shows how the entity (slot) ‘location’ is defined as mandatory and how the value is stored in a context variable.

alexa-watson-1

The next screenshot shows how the location is automatically used in the next ‘weather’ intent.

alexa-watson-2

To build your own Alexa skills via OpenWhisk and Watson, check out the instructions in the GitHub project.

Thanks a lot to my colleague Ansgar Schmidt for his help.

  • Christian Gawron

    Hi Niklas, in the screenshots you use a (Alexa) custom slot type BAG_OF_WORDS with sample text “Hello World”. Does this really work? I would have expected that you have to use the LTERAL type to get the “raw text” from Alexa. Do you have a working example for this in German (where the LITERAL slot type is not available)?
    Best wishes
    Christian Gawron

    • Niklas Heidloff

      Christian, the code does work. I haven’t tried it for German though.

      But I think you have a good point. I assume it works because I only have one slot type. I’ll look into the LITERAL type some more.

  • Max

    Hi Niklas,
    thank you so much for this post! But I have one question: I used the Bluemix Redis Cloud service instead of deploying a docker container. For the parameter REDIS_IP and REDIS_PORT I used the endpoint with respective Port provided by the Redis Cloud service dashboard. But when I wire up the Alexa Skill as you provided in your screenshots I get a an HTTP 400 Error: “There was an error calling the remote endpoint, which returned HTTP 400 : Bad Request”
    I guess it’s because of the IP and PORT parameter, but I don’t have a clue what to put there instead – can you help me out? Would be awesome!