I want to validate the user request by alexa in java

211 views Asked by At

I had a requirement to validate the user Request(i,e if user spoke i need an icecream. How can we know the user spoken icecream). Ex: i want to order a marghareeta pizza then how can we know the user Ordered marghareeta by through Amazon echo)

1

There are 1 answers

0
Vijayanath Viswanathan On

You can create custom slots for your item. For example in your scenario you have to create intent schema like,

{
  "intents": [
    {
      "slots": [
        {
          "name": "Food",
          "type": "Food"
        }
      ],
      "intent": "OrderIntentIntent"
    }
    
  ]
}

Then create a custom slot "Food" and add slot values icecream, marghareeta pizza etc. in slots. Next, in your sample utterences give utterences like below,

OrderIntentIntent I need an {Food}
OrderIntentIntent I want to order a {Food}

And {Food} can be anything and you can add it in your custom slots.

Please refer more here https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interaction-model-reference if you need further clarification