DRUG Alexa
Look at code to find methods here - Alexa ruby gem: https://github.com/QuintinAdam/alexa-rubykit
Sample Calls
Calls always start with "Alexa {Ask|Tell|Talk to|Open|Launch|Start|Use|Resume|Run|Load|Begin} AppName {what|how|to|about|for|if|whether|or whatever else you want}" followed by the rest of your command.
Alexa ask MeanAlexa to insult Cody
or
Alexa run MeanAlexa insult Cody
Team DrugAddict:
Example Calls: -
Team DrugDealer:
Example Calls: -
Team DrugMule:
Example Calls: -
Team DrugUser:
Example Calls: -
Team GorillaMan:
Example Calls: -
Team MoltenMan:
Example Calls: -
Team PhantonRider:
Example Calls: -
Team ShrunkenBones:
Example Calls: -
Contributing
After you or your team have picked which server you want fork this project and work on your own branch. When you want to test out the results make a pull request to the project and I will merge and deploy the code.
You need to define the intents in the IntentSchema and the phrases you want supported in the SampleUtterances file.
Request Body Syntax
{
"version": "string",
"session": {
"new": boolean,
"sessionId": "string",
"application": {
"applicationId": "string"
},
"attributes": {
"string": object
},
"user": {
"userId": "string"
}
},
"request": object
}
Sample Intent Request
{
"type": "IntentRequest",
"requestId": "string",
"timestamp": "string",
"intent": {
"name": "string",
"slots": {
"string": {
"name": "string",
"value": "string"
}
}
}
}
Setting up your own Alexa Ruby server (if you have your own Echo)
Base Setup
- Clone sample app:
https://github.com/QuintinAdam/alexa-rubykit
- Install eb (elastic beanstock command line tool)
- Guide:
- Command for osx:
curl -s https://s3.amazonaws.com/elasticbeanstalk-cli-resources/install-ebcli.py | python
eb --version
- Run
eb init
- Chose: us-east-1 : US East (N. Virginia)
- Adds your AWS credentials
- Make a application name
- Run
eb create
this will create your environment
- use defaults
- Verify it is up and running by logging into aws console
- Alexa only uses https so next we need to generate ssl certs
Generating SSL Certs
- In your app
mkdir temp-cert
cd temp-cert
- Generate key
openssl genrsa 2048 > privatekey.pem
- Generate a certificate request
openssl req -new -key privatekey.pem -out csr.pem
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Utah
Locality Name (eg, city) []:Salt Lake City
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Hobby
Organizational Unit Name (eg, section) []:Demo
Common Name (e.g. server FQDN or YOUR name) []:test-alexa-ruby-dev.elasticbeanstalk.com
Email Address []:quintinjadam@gmail.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
- Generate self signed certificate
openssl x509 -req -days 365 -in csr.pem -signkey privatekey.pem -out server.crt
- Upload cert to amazon
aws iam upload-server-certificate --server-certificate-name test-rubykit --certificate-body file://server.crt --private-key file://privatekey.pem
- install aws command line interface
pip install awscli
Beanstock Setup
- Back on your elastic beanstock you want to go under configurations and load balancer
- protocol must be https
- Secure listener port is 443
- select your uploaded cert (test-rubykit)
Alexa App Setup
- Create a new echo application
- Endpoint: https://test-alexa-ruby-dev.elasticbeanstalk.com (beanstock address)
- Add Intent Schema & Sample Utterances
- Upload self signed cert
cat server.crt
Pushing Changes
- Commit Changes
eb deploy
Other Notes
When deploying to eb with gems coming from git include the .ebextensions folder
openssl genrsa 2048 > privatekey.pem
openssl req -new -key privatekey.pem -out csr.pem
openssl x509 -req -days 365 -in csr.pem -signkey privatekey.pem -out server.crt
aws iam upload-server-certificate --server-certificate-name APPNAME --certificate-body file://server.crt --private-key file://privatekey.pem
cat server.crt
https://console.aws.amazon.com/elasticbeanstalk https://developer.amazon.com/edw/home.html#/ https://console.aws.amazon.com/lambda/home?region=us-east-1#/functions