Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Damon Deng
Solutions Architect, Amazon Web Servi...
Sponsor
Overview
• “Alexa, What is Amazon Lex?”
• Going Serverless (AWS Lambda & Amazon API
Gateway)
• Integrating with Facebook
•...
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...
Lex Bot Structure
Utterances
Spoken or typed phrases that invoke
your intent
BookHotel
Intents
An Intent performs an actio...
“Book a Hotel”
Book Hotel
NYC
“Book a Hotel in
NYC”
Automatic Speech
Recognition
Hotel Booking
New York City
Natural Langu...
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 functi...
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
Clou...
Auth option #2: Custom Lambda authorizer
Internet
Mobile
apps
Websites
Partner
Services
AWS Lambda
functions
Policy
cache
...
Auth option #3: Amazon Cognito User Pools
Internet
Mobile
apps
Partner
Services
AWS Lambda
functions
Endpoints on
Amazon E...
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
Dynamo...
#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:...
#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...
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
Integrate Your Amazon Lex Chatbot with Any Messaging Service
Integrate Your Amazon Lex Chatbot with Any Messaging Service
Nächste SlideShare
Wird geladen in …5
×

Integrate Your Amazon Lex Chatbot with Any Messaging Service

1.332 Aufrufe

Veröffentlicht am

Amazon Lex offers built-in integrations with Slack, Twilio, Marketo, Salesforce, Quickbooks, Microsoft Dynamics, Zendesk, and Hubspot. But, you can also integrate with any other application by combining the Lex API and AWS API Gateway to extend your chatbots into virtually any use case with minimal effort.

This session will show you how. The design pattern shown will be interesting to folks who want to build a pre-processing layer in front of Lex or want to route messages to multiple specialized bots.

  • There are over 16,000 woodworking plans that comes with step-by-step instructions and detailed photos, Click here to take a look ★★★ http://tinyurl.com/y3hc8gpw
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier

Integrate Your Amazon Lex Chatbot with Any Messaging Service

  1. 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
  2. 2. Sponsor
  3. 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. 4. The Need for Amazon Lex Amazon Lex Graphical User Interface Conversational Interface
  5. 5. Text and Speech Language Understanding Speech Recognition Natural Language Understanding Powered by the same Deep Learning technology as Alexa
  6. 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. 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. 8. Serverless, event-driven compute service AWS Lambda = microservice without servers AWS Lambda
  9. 9. Components of AWS Lambda • An AWS Lambda function (that you write) • An event source • The AWS Lambda service • The function networking environment
  10. 10. Amazon API Gateway Create Configure Publish Maintain Monitor Secure Fully Managed Service for Your APIs
  11. 11. API Authorization: 3 Options
  12. 12. 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
  13. 13. 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
  14. 14. 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
  15. 15. Built-in integrating Amazon Lex with FaceBook
  16. 16. Create Facebook App
  17. 17. Create page
  18. 18. Generating Token
  19. 19. Create Lex Bot
  20. 20. Setup Facebook Channel
  21. 21. Setup webhook
  22. 22. Testing the page
  23. 23. Integrating Amazon Lex with Twilio SMS
  24. 24. Amazon LexLambda Function Amazon API Gateway End User Twilio Programmable SMS Architecture / Message Flow
  25. 25. 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”
  26. 26. #1: Setting up a Twilio Phone Number https://www.twilio.com/try-twilio
  27. 27. #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()); } });
  28. 28. #3: HTTPS Endpoint using Amazon API Gateway
  29. 29. #4: Configuring the Twilio Webhook https://www.twilio.com/console
  30. 30. Your bot can now text!
  31. 31. 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
  32. 32. Getting Started https://console.aws.amazon.com/lex
  33. 33. Remember to complete your evaluations!
  34. 34. Thank you! Get Started: https://aws.amazon.com/lex Lex Console: https://console.aws.amazon.com/lex

×