Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The alexa_demo submodule exists to demonstrate how to create a "plugin" module that responds to Alexa intents. However, it does so in a very minimal way. It doesn't demonstrate common tasks like getting slot values, handling multiple intents, etc.
Proposed resolution
Improve the alexa_demo submodule by adding demonstration of getting Slot values, returning SSML responses, handling more than one intent. Call $response->endSession() when appropriate.
Comment | File | Size | Author |
---|---|---|---|
#8 | improve_alexa_demo-2876695-7.patch | 3.13 KB | hampercm |
#6 | improve_alexa_demo-2876695-6.patch | 3.05 KB | hampercm |
Comments
Comment #2
emerham CreditAttribution: emerham as a volunteer commentedalso to add that the demo no longer auto stops, you have to send the
setting at the end of the response. So default case would look like
Comment #3
hampercm CreditAttribution: hampercm at Acquia commentedGood point, @emerham! That's something I've been meaning to fix for a while now.
Comment #4
emerham CreditAttribution: emerham as a volunteer commentedI've been hacking away at the demo module trying to get slots to work, it appears there is some fragmentation in Github with different Alexa library forks. I am interesting in more development with skills and drupal integration so i will be spending some time poking around and programming here and there.
Comment #5
hampercm CreditAttribution: hampercm at Acquia commentedThis patch for the 7.x branch makes the alexa_demo module a much more fleshed out example, demonstrating slots, SSML, endSession(), Help and Stop/Cancel built-in Intents, and handling of launch and session-end requests.
I'll port it for the 8.x branch.
Comment #6
hampercm CreditAttribution: hampercm at Acquia commentedUpdate sample_intents.json to specify StopIntent
Comment #7
emerham CreditAttribution: emerham as a volunteer commentedLet me know if you need any help with the 8 version.
Comment #8
hampercm CreditAttribution: hampercm at Acquia commentedStraightforward port of #6 to Drupal 8
Comment #9
gambryI want to flag a module I've been working on trying to unify the Intents coding aspects: Chatbot API.
The aim is to code the intent logic once and implement it with multiple services. Additionally I'll release soon the Views integration, giving the possibility for Intents to filter and iterate through content listed in a View.
It uses D8 plugins system, so I don't think it will ever sees a D7 version.
Comment #10
emerham CreditAttribution: emerham as a volunteer commented@hampercm I have tested the patch in 8 and it works great. This will get me going in my custom module for managing a thread DB for a hobby.
@gambry
Unification of all the intent's would be a good idea as long as everything will work the same.
Comment #11
gambry@emerham chatbot_api successfully talks with Alexa and Api.AI using the same code and logic. The interfaces and the plugin system make sure the unification works great and as far as the driver implement those in the right way for the developer and site-builder point of view everything IS the same. It doesn't matter if your website need to talk to one, two or hundred of services.
And the Drupal Console and Views integration are the cherries on the cake.
I need testers before finalising version 1.0, so I would be very pleased to have feedbacks.
Comment #12
Chris CharltonThose changes (in comment #6) to the D7 'alexa_demo' module are good. Much better and more thorough.