Built in Slot Types
AMAZON.DATE |
“today”, “tomorrow”, or “july” |
“2015-07-00T9” |
AMAZON.DURATION |
“five minutes” |
“PT5M” |
AMAZON.FOUR_DIGIT_NUMBER |
"nineteen eighty four" |
1984 |
AMAZON.NUMBER |
“five” |
"5" |
AMAZON.US_CITY |
all US cities with pop. > 100K |
"Seattle" |
AMAZON.US_STATE |
US states, territories, and D.C. |
"John" |
AMAZON.US_FIRST_NAME |
recognizes popular first names |
Sample Utterances
GetHoroscope what is the horoscope for {Sign}
GetHoroscope what will the horoscope for {Sign} be on {Date}
GetHoroscope get me my horoscope
GetHoroscope {Sign}
...
GetLuckyNumbers what are my lucky numbers
GetLuckyNumbers tell me my lucky numbers
...
MatchSign do {FirstSign} and {SecondSign} get along
MatchSign what is the relationship between {FirstSign} and {SecondSign}
|
The name of the intent on the left.
The phrase a user might speak to signal that intent on the right.
Slots {SlotName} are arguments to intents.
Custom Slots Example
{ "intents": [
{ "intent": "GetHoroscope",
"slots": [
{ "name": "Sign",
"type": "LIST_OF_SIGNS" },
{ "name": "Date",
"type": "AMAZON.DATE" }
] },
{ "intent": "MatchSign",
"slots": [
{ "name": "FirstSign",
"type": "LIST_OF_SIGNS" },
{ "name": "SecondSign",
"type": "LIST_OF_SIGNS" }
] },
{ "intent": "GetLuckyNumbers" }
] }
|
|
|
Built-In Intents
AMAZON.CancelIntent |
"Cancel," "Never mind," "Forget it" |
AMAZON.HelpIntent |
"Help," "Help me," "Can you help me" |
AMAZON.NoIntent |
"No," "No thanks |
AMAZON.RepeatIntent |
"Repeat," "Say that again," "Repeat that" |
AMAZON.StartOverIntent |
"Start over," "Restart," "Start again" |
AMAZON.StopIntent |
"Stop," "Off," "Shut up" |
AMAZON.YesIntent |
"Yes," "Yes please," "Sure" |
Implement Built-in Intent Schema
{
"intents": [
{ "intent": "GetFirstEventIntent",
"slots": [
{ "name": "day",
"type": "AMAZON.DATE" }
]
},
{ "intent": "GetNextEventIntent" },
{ "intent": "AMAZON.HelpIntent" },
{ "intent": "AMAZON.StopIntent" }
]
}
|
Implement Built-in Intent Code
@Override
public SpeechletResponse onIntent(final IntentRequest request, final Session session)
throws SpeechletException {
log.info("onIntent requestId={}, sessionId={}", request.getRequestId(),
session.getSessionId());
Intent intent = request.getIntent();
String intentName = intent.getName();
if ("GetFirstEventIntent".equals(intentName)) {
return handleFirstEventRequest(intent, session);
} else if ("GetNextEventIntent".equals(intentName)) {
return handleNextEventRequest(session);
} else if ("AMAZON.HelpIntent".equals(intentName)) {
// Handling for the help intent goes here
} else if ("AMAZON.StopIntent".equals(intentName)) {
// Handling for the stop intent goes here.
} else {
throw new SpeechletException("Invalid Intent");
}
}
|
Response Object
{
version: '1.0',
response: {
outputSpeech: { // Always part of the response
type: 'PlainText', // Always this value
text: 'Example speech' // Text that will be spoken back to user
},
shouldEndSession: true, // Always part of the response--boolean for if session has ended (no more user input)
reprompt: { // Optional, if you want to customize what Alexa says if user doesn't respond correctly/at all
outputSpeech: {
type: 'PlainText',
text: 'Example reprompt'
}
},
card: { // Optional, if you want to show a card in the Echo app
type: 'Simple',
title: 'Example title',
content: 'Example card content'
}
},
sessionAttributes: {} // If you need some attributes to be kept in the session
}
|
|