6

I want to create slot type for the response that I am getting from the user because I want to query again using that slot. Could not find any official documentation saying whether this is possible or not.

3 Answers3

5

I think that, in fact, this is possible. You have to define a custom slot type, as explained here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/defining-the-voice-interface#custom-slot-types

Now, the custom slot type asks you to provide possible values, which you should do. BUT! It seems that Alexa will still parse slot values correctly even if they are not in the list of possible values that you provided!

This seems to be an undocumented feature and what I am telling you is based on my own observations: My custom slot type is taking on unexpected values

In general, my impression is that the interaction model as a whole should be seen less as a strict set of rules and more as a guideline that is interpreted at the discretion of the Alexa Voice Service.

Konstantin Schubert
  • 2,661
  • 1
  • 26
  • 39
  • 1
    That's not necessarily a feature, though. It drives me crazy currently, because I have a slot type, that I want to be the specific values I provide. – Max Mar 29 '17 at 20:01
  • its not undocumented :) 'Note that a custom slot type is not the equivalent of an enumeration. Values outside the list are still returned if recognized by the spoken language understanding system. Although input to a custom slot type is weighted towards the values in the list, it is not constrained to just the items ...' https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interaction-model-reference – Mark Aug 29 '17 at 10:44
4

I was able to achieve this exact thing by creating a custom intent called "Search" with a custom slot type called 'query.' This sends whatever the user says in the slot value to my web service where I can search by string.

I had to put in one example in the slot values section (to pass validation) but in my testing the slot is receiving dynamic data and passing to to my web service as you would expect it to. See attached screen shots.

screen shot of search intent

Community
  • 1
  • 1
Mike Doyle
  • 318
  • 2
  • 11
  • I had created slot type query. But its not working("slots": [ { "name": "query", "type": "query" } ]==>Error: There was a problem with your request: Unknown slot type 'query' for slot 'query' ). Could you please share the sample intent schema? – Abdul Manaf Oct 20 '17 at 11:06
2

I think you mean Alexa Skills Kit, not Alexa Voice Service. It is the Alexa Skills Kit that you write a skill (application) with and is the element that composes replies to the user.

No, you cannot spontaneously make up slot types. The interaction model, which includes the slot types, is used by the Alexa service to convert the sound data into the intent+slots. In order to return the highest quality, they require a fixed interaction model. This is supplied at design time and "compiled" into their recognition level. Therefore they do not support features that require ad-hoc changing of the interaction model.

Joseph Jaquinta
  • 2,080
  • 17
  • 15
  • 2
    Well they do support it if you specifically want to make a home skill. The fact that the discovery function on the home skill is possible gives me hope that they will eventually carry over this kind of functionality to the custom skills. – master565 Jun 27 '16 at 13:18