{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Also uses Custom::LexSlotType and Custom::LexIntent sample template version 1.0.3 as an external reference, to supply the slots for the Intent.", "Parameters": { "BotName": { "Type": "String", "Default": "OrderPizzaBot", "Description": "Change this to do something that requires replacement of the Bot resource, to test it." }, "IntentName": { "Type": "String", "Default": "OrderPizza", "Description": "Change this to do something that requires replacement of the Intent resource, to test it." }, "CrustTypeValue": { "Type": "String", "Default": "thin", "Description": "Use this to change a slot value that the intent depends on. Good for testing what happens when a resource that the intent explicitly depends on is updated, propagating that to the resource. None of the actual params of the Intent change, invoking the NoUpdate callback in the SDKAlias code imlpementation of the resource." }, "IntentDescription": { "Type": "String", "Default": "Intent to order a pizza from a local pizzeria.", "Description": "Change this for a non-replacement-required Update to the Intent, for testing." }, "BotDescription": { "Type": "String", "Default": "Bot which orders a pizza from a local pizzeria.", "Description": "Change this for a non-replacement-required Update to the Bot, for testing." } }, "Resources": { "PizzaSauceTypeSlot": { "Type": "Custom::LexSlotType", "Properties": { "ServiceToken": { "Fn::ImportValue": "cfn-lex-slot-type-1-0-3-ServiceToken" }, "name": "PizzaSauceType", "description": "Pizza sauce type slot (normal vs white pie)", "enumerationValues": [ { "value": "red" }, { "value": "white" } ] } }, "PizzaCrustTypeSlot": { "Type": "Custom::LexSlotType", "Properties": { "ServiceToken": { "Fn::ImportValue": "cfn-lex-slot-type-1-0-3-ServiceToken" }, "name": "PizzaCrustType", "description": "Pizza crust type slot.", "enumerationValues": [ { "value": { "Ref": "CrustTypeValue" } }, { "value": "thick" } ] } }, "PizzaTypeSlot": { "Type": "Custom::LexSlotType", "Properties": { "ServiceToken": { "Fn::ImportValue": "cfn-lex-slot-type-1-0-3-ServiceToken" }, "name": "PizzaType", "description": "Pizza type slot (veggie vs cheese).", "enumerationValues": [ { "value": "veg" }, { "value": "veggie" }, { "value": "vegetable" }, { "value": "cheese" }, { "value": "plain" } ] } }, "OrderPizza": { "Type": "Custom::LexIntent", "DependsOn": [ "PizzaTypeSlot", "PizzaCrustTypeSlot", "PizzaSauceTypeSlot" ], "Properties": { "ServiceToken": { "Fn::ImportValue": "cfn-lex-intent-1-0-3-ServiceToken" }, "name": { "Ref": "IntentName" }, "confirmationPrompt": { "maxAttempts": 1, "messages": [ { "content": "Should I order your {Crust} crust {Type} pizza with {Sauce} sauce?", "contentType": "PlainText" } ] }, "description": { "Ref": "IntentDescription" }, "fulfillmentActivity": { "type": "ReturnIntent" }, "rejectionStatement": { "messages": [ { "content": "Ok, I'll cancel your order.", "contentType": "PlainText" }, { "content": "I cancelled your order.", "contentType": "PlainText" } ] }, "sampleUtterances": [ "Order me a pizza.", "Order me a {Type} pizza.", "I want a {Crust} crust {Type} pizza", "I want a {Crust} crust {Type} pizza with {Sauce} sauce." ], "slots": [ { "name": "Type", "description": "The type of pizza to order.", "priority": 1, "sampleUtterances": [ "Get me a {Type} pizza.", "A {Type} pizza please.", "I'd like a {Type} pizza." ], "slotConstraint": "Required", "slotType": "PizzaType", "slotTypeVersion": "$LATEST", "valueElicitationPrompt": { "maxAttempts": 1, "messages": [ { "content": "What type of pizza would you like?", "contentType": "PlainText" }, { "content": "Vegie or cheese pizza?", "contentType": "PlainText" }, { "content": "I can get you a vegie or a cheese pizza.", "contentType": "PlainText" } ] } }, { "name": "Crust", "description": "The type of pizza crust to order.", "priority": 2, "sampleUtterances": [ "Make it a {Crust} crust.", "I'd like a {Crust} crust." ], "slotConstraint": "Required", "slotType": "PizzaCrustType", "slotTypeVersion": "$LATEST", "valueElicitationPrompt": { "maxAttempts": 1, "messages": [ { "content": "What type of crust would you like?", "contentType": "PlainText" }, { "content": "Thick or thin crust?", "contentType": "PlainText" } ] } }, { "name": "Sauce", "description": "The type of sauce to use on the pizza.", "priority": 3, "sampleUtterances": [ "Make it {Sauce} sauce.", "I'd like {Sauce} sauce." ], "slotConstraint": "Required", "slotType": "PizzaSauceType", "slotTypeVersion": "$LATEST", "valueElicitationPrompt": { "maxAttempts": 1, "messages": [ { "content": "White or red sauce?", "contentType": "PlainText" }, { "content": "Garlic or tomato sauce?", "contentType": "PlainText" } ] } } ] } }, "OrderPizzaBot": { "Type": "Custom::LexBot", "DependsOn": [ "OrderPizza" ], "Properties": { "ServiceToken": { "Fn::ImportValue": "cfn-lex-bot-1-0-3-ServiceToken" }, "name": { "Ref": "BotName" }, "abortStatement": { "messages": [ { "content": "I don't understand. Can you try again?", "contentType": "PlainText" }, { "content": "I'm sorry, I don't understand.", "contentType": "PlainText" } ] }, "childDirected": true, "clarificationPrompt": { "maxAttempts": 1, "messages": [ { "content": "I'm sorry, I didn't hear that. Can you repeate what you just said?", "contentType": "PlainText" }, { "content": "Can you say that again?", "contentType": "PlainText" } ] }, "description": { "Ref": "BotDescription" }, "idleSessionTTLInSeconds": 300, "intents": [ { "intentName": { "Ref": "OrderPizza" }, "intentVersion": "$LATEST" } ], "locale": "en-US", "processBehavior": "BUILD" } } }, "Outputs": { "OrderPizzaBotChecksum": { "Description": "The checksum of the Lex Bot for this stack.", "Value": { "Fn::GetAtt": [ "OrderPizzaBot", "checksum" ] } }, "OrderPizzaBotVersion": { "Description": "The version of the Lex Bot for this stack.", "Value": { "Fn::GetAtt": [ "OrderPizzaBot", "version" ] } } } }