GithubHelp home page GithubHelp logo

deepu0 / alexabot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from utk1801/alexabot

0.0 1.0 0.0 15 KB

This is an alexa skill which gives you a Yoda quote when you ask for it.

Python 100.00%

alexabot's Introduction

Alexa with Yoda quotes

Introduction

This is an alexa skill which gives you a Yoda quote when you ask for it. It can also be used a a boilerplate for building alexa skills.

How does it work?

Workflow

You can test out this skill using an Amazon Echo device or at Echosim. The workflow is as follows:

  • You invoke the skill saying "Alexa, say Yoda Quote."
  • Alexa will give you a yoda quote and ask if you want more.
  • If you say yes, it would again give you a yoda quote and ask if you want more. If you say no, it will exit out of the skiil.
  • It also supports Help intent, which gives the user an introduction to what the app is all about and help them get started with the skill use.

Internal Implementation

This skill is written in Python using Flask and the python library Flask-Ask. The Implementation is as follows:

  • When you invoke the skill, one of the Yoda quotes is fetched from the database (this data comes along with this project. Don't worry about adding it yourself)and spoken out by Alexa along with a question if you want more of yoda quotes.
  • If you say yes, first step repeats.
  • If you say no, Alexa echoes "Bye" and exits out of the skill.

How to get it up and running?

Deployment

This skill gets deployed instantly. Also, Hasura automatically generates SSL certificates for you. Just run the following commands to deploy your skill.

(Make sure you have hasura-cli)

$ hasura quickstart /alexa-yoda-bot
$ cd alexa-yoda-bot
$ git add . && git commit -m "Initial Commit"
$ git push hasura master

How to add the skill to your Amazon account?

To link it with your Amazon Echo Device, go to your Amazon developer console.

  1. Create a new skill. Call it Yoda Quote. Give the invocation name as yoda quote. Click next.

  2. Add this intent schema

{
  "intents": [
    {
      "intent": "YesIntent"
    },
    {
      "intent": "NoIntent"
    },
    {
      "intent": "HelpIntent"
    },
    {
      "intent": "StopIntent"
    },
    {
      "intent": "CancelIntent"
    }
  ]
}

Leave custom slot types empty. Add the following sample utterances

YesIntent yes
YesIntent sure
YesIntent yeah
YesIntent ok
NoIntent no
NoIntent no thanks
NoIntent nope
HelpIntent help
HelpIntent whats this skill about
StopIntent stop
CancelIntent cancel

Click next.

  1. For the service endpoint, check the HTTPS radio button.

    Put the default URL as https://bot.<cluster-name>.hasura-app.io/yoda_quotes. (Run $ hasura cluster status from root directory to know your cluster name).

    Note: For quick testing, we have one skill service live at https://bot.drover65.hasura-app.io/yoda_quotes. (This test service will work only if you have followed 1 and 2)

    Click next.

  2. About SSL certificates, Hasura services have auto generated LetsEncrypt Grade A SSL certificates. This means, you have to check the radio button that says My development endpoint has a certificate from a trusted certificate authority

    Click next.

  3. Your skill is live on the ECHO device associated with your account. Test it by saying Alexa, load yoda quote. And Alexa will give you Yoda wisdom :)

How to use it as a boilerplate?

The source code lies in the microservices/bot/app/src directory. This is a simple application, so the entire code lies in server.py.

You might want to go through the Flask-ask docs (a very quick read).

Support

If you happen to getstuck at any point, feel free to mail me at [email protected]. Also, if you find an error or a bug, please raise an issue here.

alexabot's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.