question

TheLastJedi avatar image
TheLastJedi asked ·

I want to prompt a list of items to user, out of which he can choose one and proceed. Also that list will be fetched from an external web service. Any ideas on how to implement this?

To be clear this will be the scenario -
Alexa to user - 'What do you want to eat?'
User - 'Fruit'
Alexa - 'Here is the list of fruits available, Apples, mangoes, oranges....' //<-- Looking for this Implementation
I will fetch the list from a external web service based on user response. I'm using Java for the handler services which is hosted on my own cloud space.

alexa skills kitintentsjavaalexa listslist api
1 comment
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

u can just send the traffic to u products ................simple

u don't need all of this

0 Likes 0 ·

1 Answer

IS avatar image
IS answered ·

Hello.

The description of what you are doing is VERY vague (e.g. no programming language, no indication of the level of your expertise, etc.). So I would suggest you to go through some tutorials and resources and have a look how to create skills - probably, you will find answers to your questions. You can start here

Here is doc on how to specify list of words to choose from for user - as a value of a custom slot type.

If the question is how to make Alexa choose from a dynamically changed list of values, then the answer is it is not possible this way. Because skill model needed to be compiled before it can be used. BUT there are some things you can do:

1) During the model creation, add as many possible variants of value for the particular slot as you can. Slot values do not work as a predefined set (though Alexa will be very biased to these values), and Alexa will be able to capture similar values. (This works not very good for me on practice)

2) Use newly introduced AMAZON.SearchQuery slot type to capture whatever your user said, and then compare the value Alexa sends to lambda with the list you have.

Please provide more information if you want more specific answer.

Cheers!

3 comments
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi There,

I've gone through the tutorials and resources. Here is the thing, I have a list of items to be prompted to user. I'm using Java for handler service.

0 Likes 0 ·

If you have a list of items, you just need to send them back to the user like so:

'FruitIntent' : function() {
        var array = [];
        array = getExternalList(); //assuming you already have the external api stuff sorted
        this.response.speak('Here is the list of fruits available: ' + array);
        this.response.listen('Here is the list of fruits available: ' + array);
        this.emit(':responseReady');
    }

This is just a super quick example, but that is how you would present the list of items you have back to the user

1 Like 1 ·