Developing Locally with Bespoken Tools
Alexa skill developers, Run Lambdas locally as local services for faster developing. Run your lambda as an HTTP service. Get BST CLI, and read more.
I read yesterday’s blog post from Amazon on developing Alexa skills locally with great interest, as accelerating Alexa Skill development is a focus for us. The practices they outline are very useful. I did want to quickly point out what we are doing with our Bespoken Tools, and how we think we can even further improve and streamline the skill development experience. The approaches are not at all mutually exclusive, so our goal is to inform people about the tools we provide. By understanding all the capabilities available, developers can make the best decision on how to setup their environment.Et voila! Your lambda will be running as an HTTP service at:(Port is configurable, but by default it listens on 10000). And in addition to the techniques mentioned in the blog post (such as sending JSON payloads directly to it), you can also receive actual requests from Alexa on the local service. That’s right – the real requests – not just your own locally-crafted JSON, but the actual payload from interacting with an Echo, the Service Simulator, Echosim.io, etc. Whatever device you prefer to test with. This requires configuring your Alexa skill to look at a special URL (printed out on the command-line when you start the proxy), but once you do, you will be working in what we call beast mode – rampage through dev/test cycles, terrorize bugs and crush out features. Fun, right? 🙂And we will correctly turn it into a HelloWorldIntent, send it to the service, while showing you both the request and response from the service. Reference docs for the command are here.
Running Lambdas Locally As Local ServicesIn the blog, it describes under “Add The Code” essentially how to turn an AWS Lambda into a runnable local service. Conveniently, and without any cutting or pasting, our bst proxy does the same thing 🙂 A full tutorial is here but once our bst cli is installed, just enter:
$ bst proxy lambda <LAMDBA_FILE>
Testing IntentsThe blog then proceeds to describe testing your local service using JSON files. This is a great method of testing. But we have another way, which can be even easier to use depending on your setup. That is our bst speak command. It uses the local version of your IntentSchema and SampleUtterances to take phrases and turn them into intents, then into JSON, which is then automatically sent to your local service! So, if you started a proxy as described before, just enter:
$ bst speak Hello World
ConclusionWe point these items out to make developers aware of what we think are some pretty neat tools we are building. The goal is to help them build skills faster and better. We hope Alexa devs will see Bespoken Tools as a great addition to their toolbelt. Additionally, though our focus to-date has been on command-line tools, we are now rolling out a programmatic API. We consider it still in “preview” mode, but we think it will greatly help Alexa devs with two thorny problems:
- Unit testing Alexa Skills and integrating those tests with CI
- Working with the AudioPlayer interface
The Standard StuffTalk to us on Gitter. Stay updated through GitHub.
Debugging Alexa Skills With VS Code and Bespoken - Part 2
Unit tests are a great way to test your skills, and they work even better when combined with a debugger. This is one of the fastest and most effective
How to Solve the Toughest Problem in Voice Development and Design
Bespoken's new Usability Performance Testing is solving the toughest problem in voice development and design. Check out our case study with Opearlo an