1
votes

I am trying to create an alexa skill that can take multiple words as input and can read it out to user. Here is my Intent Schema:

{
  "intents": [
    {
      "intent": "AMAZON.CancelIntent"
    },
    {
      "intent": "AMAZON.StopIntent"
    },
    {
      "intent": "AMAZON.HelpIntent"
    },
    {
      "intent": "madlibIntent",
      "slots": [
        {
          "name": "STEPVALUE",
          "type": "AMAZON.LITERAL"
        },
        {
          "name": "duration",
          "type": "AMAZON.NUMBER"
        }
      ]
    }
  ]
}

I'm using AMAZON.LITERAL to take multiple words as input from user. My sample utterances are given below:

madlibIntent begin madlib madlibIntent build madilb madlibIntent {z|STEPVALUE} madlibIntent {z z|STEPVALUE} madlibIntent {duration}

The problem is: it can take one word as input when uttered and can read it out. But if the user says multiple word, it can't take any word as input. For example: It can take 'nice' as input but doesn't get 'very nice'. Can anyone help me finding out what's wrong with it?

1

1 Answers

0
votes

I found the solution! The sample utterance should be written in this form:

madlibIntent begin madlib
madlibIntent build madilb
madlibIntent {STEPVALUE}
madlibIntent {STEPVALUE} {STEPVALUE}
madlibIntent {STEPVALUE} {STEPVALUE} {STEPVALUE}

You need to build custom slot with one,two and three words instead of just using AMAZON.LITERAL so that it can take one, two or three words as input. If you want to take four or more words as input, just create more lines in Sample utterances and keep adding {STEPVALUE} or whatever the name of your custom intent is.