SlideShare a Scribd company logo
1 of 36
Download to read offline
© 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

More Related Content

What's hot

Amazon Connect Bootcamp
Amazon Connect BootcampAmazon Connect Bootcamp
Amazon Connect BootcampCloudHesive
 
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
 
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopBuilding a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopAmazon Web Services
 
Introduction to Chatbots
Introduction to ChatbotsIntroduction to Chatbots
Introduction to ChatbotsDaden Limited
 
Build an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdfBuild an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdfStephenAmell4
 
reInvent reCap 2022
reInvent reCap 2022reInvent reCap 2022
reInvent reCap 2022CloudHesive
 
An Introduction To Chat Bots
An Introduction To Chat BotsAn Introduction To Chat Bots
An Introduction To Chat BotsSohan Maheshwar
 
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...DianaGray10
 
Amazon Connect Technical Introduction & Use Cases
Amazon Connect Technical Introduction & Use CasesAmazon Connect Technical Introduction & Use Cases
Amazon Connect Technical Introduction & Use CasesCloudHesive
 
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
 
Get started with Dialogflow & Contact Center AI on Google Cloud
Get started with Dialogflow & Contact Center AI on Google CloudGet started with Dialogflow & Contact Center AI on Google Cloud
Get started with Dialogflow & Contact Center AI on Google CloudDaniel Zivkovic
 
Event Streaming in the Telco Industry with Apache Kafka® and Confluent
Event Streaming in the Telco Industry with Apache Kafka® and ConfluentEvent Streaming in the Telco Industry with Apache Kafka® and Confluent
Event Streaming in the Telco Industry with Apache Kafka® and Confluentconfluent
 
Copilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdfRiccardo Zamana
 

What's hot (20)

Introduction to Sagemaker
Introduction to SagemakerIntroduction to Sagemaker
Introduction to Sagemaker
 
Amazon Connect Bootcamp
Amazon Connect BootcampAmazon Connect Bootcamp
Amazon Connect Bootcamp
 
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
 
Conversational AI: What's New?
Conversational AI: What's New?Conversational AI: What's New?
Conversational AI: What's New?
 
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopBuilding a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
 
Introduction to Chatbots
Introduction to ChatbotsIntroduction to Chatbots
Introduction to Chatbots
 
The future of AI is hybrid
The future of AI is hybridThe future of AI is hybrid
The future of AI is hybrid
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Power Automate
Power AutomatePower Automate
Power Automate
 
Build an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdfBuild an LLM-powered application using LangChain.pdf
Build an LLM-powered application using LangChain.pdf
 
reInvent reCap 2022
reInvent reCap 2022reInvent reCap 2022
reInvent reCap 2022
 
An Introduction To Chat Bots
An Introduction To Chat BotsAn Introduction To Chat Bots
An Introduction To Chat Bots
 
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
 
Generative AI.pptx
Generative AI.pptxGenerative AI.pptx
Generative AI.pptx
 
Amazon Connect Technical Introduction & Use Cases
Amazon Connect Technical Introduction & Use CasesAmazon Connect Technical Introduction & Use Cases
Amazon Connect Technical Introduction & Use Cases
 
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
 
Get started with Dialogflow & Contact Center AI on Google Cloud
Get started with Dialogflow & Contact Center AI on Google CloudGet started with Dialogflow & Contact Center AI on Google Cloud
Get started with Dialogflow & Contact Center AI on Google Cloud
 
Event Streaming in the Telco Industry with Apache Kafka® and Confluent
Event Streaming in the Telco Industry with Apache Kafka® and ConfluentEvent Streaming in the Telco Industry with Apache Kafka® and Confluent
Event Streaming in the Telco Industry with Apache Kafka® and Confluent
 
Copilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
 
Ml ops on AWS
Ml ops on AWSMl ops on AWS
Ml ops on AWS
 

Similar to 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
 
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
 
Introducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text ChatbotsIntroducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text ChatbotsAmazon 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
 
Building Chatbots with Amazon Lex
Building Chatbots with Amazon LexBuilding Chatbots with Amazon Lex
Building Chatbots with Amazon LexAmazon Web Services
 

Similar to 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
 
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...
 
Introducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text ChatbotsIntroducing Amazon Lex – Service for Building Voice or Text Chatbots
Introducing Amazon Lex – Service for Building Voice or Text Chatbots
 
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...
 
Building Chatbots with Amazon Lex
Building Chatbots with Amazon LexBuilding Chatbots with Amazon Lex
Building Chatbots with Amazon Lex
 

More from 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
 

More from 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