This library is for building Amazon Alexa custom skills with Go. Unfortunately Amazon does only provide Alexa SDKs for building skills with Java and NodeJS.
Supported features:
- Amazon Alexa Custom skills in general
- Custom Skill as webservice backend (AWS - Host a Custom Skill as Web Service)
- Custom Skill as Lambda function (AWS - Host a Custom Skill as an AWS Lambda Function)
- GameEngine and Gadget Skill API (AWS - Understand Gadgets Skill API)
- Dialog Interface (AWS - Dialog Interface Reference)
- Display Interface (AWS - Display Interface Reference)
- AudioPlayer Interface (AWS - AudioPlayer Interface Reference)
- Device Address Service (AWS - Enhance you skill with customer address information)
- SessionStorage - store data in session attribute
There is a excellent API description what attributes must be included in responses and how to use the different interfaces in the AWS Request and Response JSON reference
Amazon has an exhaustive description of the Alexa API including all the request and response objects. This library mapped the objects to structs and provides a way to interact with the Alexa Voice Service.
The connection is either via Web Service for self hosted custom skills or AWS Lambda Function for skill hosted at the AWS Lambda Function service. The second option is a easier deployment way because a developer has not to think about valid HTTPS certificates.
The examples show the usage of the library for different Alexa controllers. Every example resides in its own folder and does not reference other examples.
Usage:
- Copy the Go file(s) from one of the examples folders (e.g.
examples/helloworld/main.go
) in a Go project - Run
go get ./...
- Run
go build
- Execute the binary!
The AWS Alexa skill setup is described in the original tutorials. The ApplicationID from the Alexa skill must be configured in the skill definition.
You need a HTTPS endpoint configured to run this skill or deploy the skill as a lambda method (coming soon).
There is a hello world example which reimplemented the Amazon hello world example. You can see how to implement different Alexa intents and use a SessionEnded and LaunchRequest handler.
Same examples as 'hello world' but it can be deployed as Amazon Lambda expression.
If you are using windows like I am it may be tricky to build the zip file with the executable file. The AWS lambda library contains a tool called build-lambda-zip
for building a .zip file with a executable binary. (See Building your function)
The Lambda Function can be deployed using the AWS CLI, AWS CloudFormation or the AWS Web console. For details see deploying Lambda Functions.
Example how to use the new Echo Gadget Buttons. The example is converted from the Amazon NodeJS Hello buttons tutorial.
The example deploys as a lambda function. The necessary steps to create the skill are described in the above tutorial.
Patrick Steinig (@patst87)