SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Damon Deng
Solutions Architect, Amazon Web Services
Integrate Your Amazon Lex
Chatbot with Any Messaging
Service
October 10, 2017
Sponsor
Overview
• “Alexa, What is Amazon Lex?”
• Going Serverless (AWS Lambda & Amazon API
Gateway)
• Integrating with Facebook
• Teach Your Bot How to Text with Twilio SMS
• Can we talk? Adding Support for Voice
The Need for Amazon Lex
Amazon Lex
Graphical User
Interface
Conversational
Interface
Text and Speech Language Understanding
Speech
Recognition
Natural Language
Understanding
Powered by the same Deep Learning technology as Alexa
Lex Bot Structure
Utterances
Spoken or typed phrases that invoke
your intent
BookHotel
Intents
An Intent performs an action in
response to natural language user
input
Slots
Slots are input data required to fulfill
the intent
Fulfillment
Fulfillment mechanism for your intent
“Book a Hotel”
Book Hotel
NYC
“Book a Hotel in
NYC”
Automatic Speech
Recognition
Hotel Booking
New York City
Natural Language
Understanding
Intent/Slot
Model
Utterances
Hotel Booking
City New York City
Check In Nov 30th
Check Out Dec 2nd
“Your hotel is booked for
Nov 30th”
Amazon Polly
Confirmation: “Your hotel
is booked for Nov 30th”
a
in
“Can I go ahead
with the booking?
Serverless, event-driven compute service
AWS Lambda = microservice without servers
AWS Lambda
Components of AWS Lambda
• An AWS Lambda function (that you write)
• An event source
• The AWS Lambda service
• The function networking environment
Amazon API Gateway
Create Configure Publish
Maintain Monitor Secure
Fully Managed Service for Your APIs
API Authorization: 3 Options
Auth option #1: SigV4 / IAM
Internet
Mobile
apps
Partner
Services
AWS Lambda
functions
Endpoints on
Amazon EC2
Amazon
CloudFront
API
Gateway
Amazon
Cognito
IAM
IAM user / role
acquisition
SigV4 credentials
Auth option #2: Custom Lambda authorizer
Internet
Mobile
apps
Websites
Partner
Services
AWS Lambda
functions
Policy
cache
Endpoints on
Amazon EC2
Any publicly
accessible
endpoint
Amazon
CloudFront
API
Gateway
Lambda custom
Auth function
OAuth
provider
403
Auth option #3: Amazon Cognito User Pools
Internet
Mobile
apps
Partner
Services
AWS Lambda
functions
Endpoints on
Amazon EC2
Amazon
CloudFront
API
Gateway
Amazon
Cognito
Websites
User login
Built-in auth
check
OIDC token
OIDC token
Any publicly
accessible
endpoint
Built-in integrating Amazon
Lex with FaceBook
Create Facebook App
Create page
Generating Token
Create Lex Bot
Setup Facebook Channel
Setup webhook
Testing the page
Integrating Amazon Lex with
Twilio SMS
Amazon LexLambda
Function
Amazon API
Gateway
End User Twilio
Programmable
SMS
Architecture / Message Flow
Multi-Bot Design
“Concierge” Bot
AWS
Lambda
Function
Amazon API
Gateway
End User Multiple
Messaging
Services
Amazon
DynamoDB
“Flight-Booking”
Bot
“Cruise-Booking”
Bot
user-id current-
intent
bot ttl
867-5309 BookCruise Cruise-Booking 1494013599
“I want to book a cruise”
#1: Setting up a Twilio Phone Number
https://www.twilio.com/try-twilio
#2: IAM Policy & the AWS Lambda Function
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"lex:PostText"
],
"Resource": [
"*"
]
}
]
}
AWS.config.region = 'us-east-1';
var lexruntime = new AWS.LexRuntime();
var userNumber = twilioSMS.From.replace('+', '');
var params = {
botAlias: process.env.BOT_ALIAS,
botName: process.env.BOT_NAME,
inputText: twilioSMS.Body,
userId: userNumber,
sessionAttributes: {
}
};
lexruntime.postText(params, function(err, data) {
var twimlResponse = new twilio.TwimlResponse();
if (err) {
console.log(err, err.stack); // an error occurred
twimlResponse.message('Sorry, we ran into a problem at our
end.');
callback(err, twimlResponse.toString());
} else {
console.log(data); // got something back from Amazon
Lex
twimlResponse.message(data.message);
callback(null, twimlResponse.toString());
}
});
#3: HTTPS Endpoint using Amazon API
Gateway
#4: Configuring the Twilio Webhook
https://www.twilio.com/console
Your bot can now text!
Adding Support for Voice
• Amazon Lex can support both Text and Voice
• Use the Twilio <record> verb to prompt/record user input
• Utilize Amazon Lex’s PostContent API call (instead of
PostText)
• Accept: text/plain
• Convert to TwiML and send back to Twilio
Getting Started
https://console.aws.amazon.com/lex
Remember to complete
your evaluations!
Thank you!
Get Started: https://aws.amazon.com/lex
Lex Console: https://console.aws.amazon.com/lex

Más contenido relacionado

La actualidad más candente

Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...
Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...
Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...Amazon Web Services
 
Introduction to Azure monitor
Introduction to Azure monitorIntroduction to Azure monitor
Introduction to Azure monitorPraveen Nair
 
Microsoft Cloud Computing - Windows Azure Platform
Microsoft Cloud Computing - Windows Azure PlatformMicrosoft Cloud Computing - Windows Azure Platform
Microsoft Cloud Computing - Windows Azure PlatformDavid Chou
 
Amazon CloudFront and Lambda@Edge
Amazon CloudFront and Lambda@EdgeAmazon CloudFront and Lambda@Edge
Amazon CloudFront and Lambda@EdgeAmazon Web Services
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaAmazon Web Services
 
Azure Functions VS AWS Lambda: overview and comparison
Azure Functions VS AWS Lambda: overview and comparisonAzure Functions VS AWS Lambda: overview and comparison
Azure Functions VS AWS Lambda: overview and comparisonAlex Zyl
 
Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...
Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...
Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...Amazon Web Services
 
An Overview of Machine Learning on AWS
An Overview of Machine Learning on AWSAn Overview of Machine Learning on AWS
An Overview of Machine Learning on AWSAmazon Web Services
 
Apache Spark and the Hadoop Ecosystem on AWS
Apache Spark and the Hadoop Ecosystem on AWSApache Spark and the Hadoop Ecosystem on AWS
Apache Spark and the Hadoop Ecosystem on AWSAmazon Web Services
 
Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge James Beswick
 
Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017
Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017
Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017Amazon Web Services
 
ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...
ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...
ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...Amazon Web Services
 
Intro to Microsoft Cognitive Services
Intro to Microsoft Cognitive ServicesIntro to Microsoft Cognitive Services
Intro to Microsoft Cognitive ServicesAmanda Lange
 

La actualidad más candente (20)

Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...
Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...
Introducing AWS DataSync - Simplify, automate, and accelerate online data tra...
 
Intro to AI & ML at Amazon
Intro to AI & ML at AmazonIntro to AI & ML at Amazon
Intro to AI & ML at Amazon
 
Introduction to Azure monitor
Introduction to Azure monitorIntroduction to Azure monitor
Introduction to Azure monitor
 
Introducing AWS Greengrass
Introducing AWS GreengrassIntroducing AWS Greengrass
Introducing AWS Greengrass
 
Machine Learning on AWS
Machine Learning on AWSMachine Learning on AWS
Machine Learning on AWS
 
The Amazon Partner Network
The Amazon Partner NetworkThe Amazon Partner Network
The Amazon Partner Network
 
Microsoft Cloud Computing - Windows Azure Platform
Microsoft Cloud Computing - Windows Azure PlatformMicrosoft Cloud Computing - Windows Azure Platform
Microsoft Cloud Computing - Windows Azure Platform
 
Amazon CloudFront and Lambda@Edge
Amazon CloudFront and Lambda@EdgeAmazon CloudFront and Lambda@Edge
Amazon CloudFront and Lambda@Edge
 
Introducing Amazon SageMaker
Introducing Amazon SageMakerIntroducing Amazon SageMaker
Introducing Amazon SageMaker
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
Firebase
FirebaseFirebase
Firebase
 
Azure Functions VS AWS Lambda: overview and comparison
Azure Functions VS AWS Lambda: overview and comparisonAzure Functions VS AWS Lambda: overview and comparison
Azure Functions VS AWS Lambda: overview and comparison
 
iNTRODUCTION TO AWS IOT
iNTRODUCTION TO AWS IOTiNTRODUCTION TO AWS IOT
iNTRODUCTION TO AWS IOT
 
Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...
Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...
Amazon FreeRTOS: IoT Operating System for Microcontrollers (IOT208-R1) - AWS ...
 
An Overview of Machine Learning on AWS
An Overview of Machine Learning on AWSAn Overview of Machine Learning on AWS
An Overview of Machine Learning on AWS
 
Apache Spark and the Hadoop Ecosystem on AWS
Apache Spark and the Hadoop Ecosystem on AWSApache Spark and the Hadoop Ecosystem on AWS
Apache Spark and the Hadoop Ecosystem on AWS
 
Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge
 
Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017
Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017
Introduction to AWS and Cloud Computing - Module 1 Part 1 - AWSome Day 2017
 
ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...
ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...
ML Workflows with Amazon SageMaker and AWS Step Functions (API325) - AWS re:I...
 
Intro to Microsoft Cognitive Services
Intro to Microsoft Cognitive ServicesIntro to Microsoft Cognitive Services
Intro to Microsoft Cognitive Services
 

Similar a Integrate Your Amazon Lex Chatbot with Any Messaging Service

Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...Amazon Web Services
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Amazon Web Services
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Amazon Web Services
 
把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成Amazon Web Services
 
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Amazon Web Services
 
WIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesWIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesAmazon Web Services
 
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Amazon Web Services
 
Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018AWS Germany
 
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...Amazon Web Services
 
使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 Amazon Web Services
 
Announcing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech TalksAnnouncing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech TalksAmazon Web Services
 
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)Amazon Web Services
 
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...Amazon Web Services
 
Getting Started with Amazon Lex - AWS Summit Cape Town 2017
Getting Started with Amazon Lex  - AWS Summit Cape Town 2017 Getting Started with Amazon Lex  - AWS Summit Cape Town 2017
Getting Started with Amazon Lex - AWS Summit Cape Town 2017 Amazon Web Services
 
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon PollyLearn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon PollyAmazon Web Services
 
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Amazon Web Services
 
Amazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex DemoAmazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex DemoAmazon Web Services
 
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)Amazon Web Services
 
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Amazon Web Services
 

Similar a Integrate Your Amazon Lex Chatbot with Any Messaging Service (20)

Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
 
把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成把您的 Amazon Lex Chatbot 與訊息服務集成
把您的 Amazon Lex Chatbot 與訊息服務集成
 
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
 
WIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesWIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS Services
 
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
 
Deep Dive: Amazon Lex
Deep Dive: Amazon LexDeep Dive: Amazon Lex
Deep Dive: Amazon Lex
 
Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018
 
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
 
使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人
 
Announcing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech TalksAnnouncing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech Talks
 
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
 
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
 
Getting Started with Amazon Lex - AWS Summit Cape Town 2017
Getting Started with Amazon Lex  - AWS Summit Cape Town 2017 Getting Started with Amazon Lex  - AWS Summit Cape Town 2017
Getting Started with Amazon Lex - AWS Summit Cape Town 2017
 
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon PollyLearn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
Learn How to Build a Bot for Voice and Text with Amazon Lex and Amazon Polly
 
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
 
Amazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex DemoAmazon Connect & Amazon Lex Demo
Amazon Connect & Amazon Lex Demo
 
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
 
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
 

Más de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Integrate Your Amazon Lex Chatbot with Any Messaging Service

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Damon Deng Solutions Architect, Amazon Web Services Integrate Your Amazon Lex Chatbot with Any Messaging Service October 10, 2017
  • 3. Overview • “Alexa, What is Amazon Lex?” • Going Serverless (AWS Lambda & Amazon API Gateway) • Integrating with Facebook • Teach Your Bot How to Text with Twilio SMS • Can we talk? Adding Support for Voice
  • 4. The Need for Amazon Lex Amazon Lex Graphical User Interface Conversational Interface
  • 5. Text and Speech Language Understanding Speech Recognition Natural Language Understanding Powered by the same Deep Learning technology as Alexa
  • 6. Lex Bot Structure Utterances Spoken or typed phrases that invoke your intent BookHotel Intents An Intent performs an action in response to natural language user input Slots Slots are input data required to fulfill the intent Fulfillment Fulfillment mechanism for your intent
  • 7. “Book a Hotel” Book Hotel NYC “Book a Hotel in NYC” Automatic Speech Recognition Hotel Booking New York City Natural Language Understanding Intent/Slot Model Utterances Hotel Booking City New York City Check In Nov 30th Check Out Dec 2nd “Your hotel is booked for Nov 30th” Amazon Polly Confirmation: “Your hotel is booked for Nov 30th” a in “Can I go ahead with the booking?
  • 8. Serverless, event-driven compute service AWS Lambda = microservice without servers AWS Lambda
  • 9. Components of AWS Lambda • An AWS Lambda function (that you write) • An event source • The AWS Lambda service • The function networking environment
  • 10. Amazon API Gateway Create Configure Publish Maintain Monitor Secure Fully Managed Service for Your APIs
  • 11.
  • 13. Auth option #1: SigV4 / IAM Internet Mobile apps Partner Services AWS Lambda functions Endpoints on Amazon EC2 Amazon CloudFront API Gateway Amazon Cognito IAM IAM user / role acquisition SigV4 credentials
  • 14. Auth option #2: Custom Lambda authorizer Internet Mobile apps Websites Partner Services AWS Lambda functions Policy cache Endpoints on Amazon EC2 Any publicly accessible endpoint Amazon CloudFront API Gateway Lambda custom Auth function OAuth provider 403
  • 15. Auth option #3: Amazon Cognito User Pools Internet Mobile apps Partner Services AWS Lambda functions Endpoints on Amazon EC2 Amazon CloudFront API Gateway Amazon Cognito Websites User login Built-in auth check OIDC token OIDC token Any publicly accessible endpoint
  • 24. Integrating Amazon Lex with Twilio SMS
  • 25. Amazon LexLambda Function Amazon API Gateway End User Twilio Programmable SMS Architecture / Message Flow
  • 26. Multi-Bot Design “Concierge” Bot AWS Lambda Function Amazon API Gateway End User Multiple Messaging Services Amazon DynamoDB “Flight-Booking” Bot “Cruise-Booking” Bot user-id current- intent bot ttl 867-5309 BookCruise Cruise-Booking 1494013599 “I want to book a cruise”
  • 27. #1: Setting up a Twilio Phone Number https://www.twilio.com/try-twilio
  • 28. #2: IAM Policy & the AWS Lambda Function { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "lex:PostText" ], "Resource": [ "*" ] } ] } AWS.config.region = 'us-east-1'; var lexruntime = new AWS.LexRuntime(); var userNumber = twilioSMS.From.replace('+', ''); var params = { botAlias: process.env.BOT_ALIAS, botName: process.env.BOT_NAME, inputText: twilioSMS.Body, userId: userNumber, sessionAttributes: { } }; lexruntime.postText(params, function(err, data) { var twimlResponse = new twilio.TwimlResponse(); if (err) { console.log(err, err.stack); // an error occurred twimlResponse.message('Sorry, we ran into a problem at our end.'); callback(err, twimlResponse.toString()); } else { console.log(data); // got something back from Amazon Lex twimlResponse.message(data.message); callback(null, twimlResponse.toString()); } });
  • 29. #3: HTTPS Endpoint using Amazon API Gateway
  • 30. #4: Configuring the Twilio Webhook https://www.twilio.com/console
  • 31. Your bot can now text!
  • 32. Adding Support for Voice • Amazon Lex can support both Text and Voice • Use the Twilio <record> verb to prompt/record user input • Utilize Amazon Lex’s PostContent API call (instead of PostText) • Accept: text/plain • Convert to TwiML and send back to Twilio
  • 34.
  • 36. Thank you! Get Started: https://aws.amazon.com/lex Lex Console: https://console.aws.amazon.com/lex