+ All Categories
Home > Software > How to Build a Serverless Chatbot for $0?

How to Build a Serverless Chatbot for $0?

Date post: 21-Feb-2017
Category:
Upload: mobile-monday-srbija
View: 181 times
Download: 1 times
Share this document with a friend
78
HOW TO BUILD A SERVERLESS CHATBOT FOR $0
Transcript
Page 1: How to Build a Serverless Chatbot for $0?

HOW TO BUILD A SERVERLESS CHATBOT

FOR $0

Page 2: How to Build a Serverless Chatbot for $0?

I’M SLOBODAN STOJANOVIC

CTO OF CLOUD HORIZON JS BELGRADE MEETUP ORGANIZER

GITHUB.COM/STOJANOVIC TWITTER.COM/SLOBODAN_

Page 3: How to Build a Serverless Chatbot for $0?

CLOUD HORIZON

WE HELP BUSINESSES BUILD INNOVATIVE WEB AND MOBILE SOLUTIONS

Page 4: How to Build a Serverless Chatbot for $0?

CHATTERBOT / CHAT BOT a type of conversational agent, a computer

program designed to simulate an intelligent conversation with one or more human users

via auditory or textual methods.

Page 5: How to Build a Serverless Chatbot for $0?

A BIT OF A HISTORY

Page 6: How to Build a Serverless Chatbot for $0?

• Turing Test (1950) • Eliza (1966) • Parry (1972) • A.L.I.C.E. (1995) • Jabberwacky (2005) • Slack Bot (2014) • Telegram and FB Bots (2015) • Many others (2016)

Page 7: How to Build a Serverless Chatbot for $0?

WHEN PARRY MET ELIZA

Page 8: How to Build a Serverless Chatbot for $0?
Page 9: How to Build a Serverless Chatbot for $0?

CHATBOT PLATFORMS

Page 10: How to Build a Serverless Chatbot for $0?
Page 11: How to Build a Serverless Chatbot for $0?
Page 12: How to Build a Serverless Chatbot for $0?

HOW CHATBOTS WORK

Page 13: How to Build a Serverless Chatbot for $0?
Page 14: How to Build a Serverless Chatbot for $0?

MOST OF THEM ARE USING WEBHOOKS

Page 15: How to Build a Serverless Chatbot for $0?

Hello

{ sender: { id: 12345 }, recipient: { id: 54321 }, timestamp: 1483413621558, message: { app_id: 999999, text: 'Hello' }}

{ recipient: { id: '12345' }, message: { text: 'Hi there' }}

Hi there

Page 16: How to Build a Serverless Chatbot for $0?

MOST OF THEM? WHAT ABOUT THE DIFFERENT ONES?

Page 17: How to Build a Serverless Chatbot for $0?

• Slack Bot users • Amazon Alexa • iMessage and Siri

Page 18: How to Build a Serverless Chatbot for $0?

WHAT DO YOU NEED TO KNOW TO BUILD A CHATBOT

Page 19: How to Build a Serverless Chatbot for $0?

ARTIFICIAL INTELLIGENCE

Page 20: How to Build a Serverless Chatbot for $0?

NATURAL LANGUAGE PROCESSING

Page 21: How to Build a Serverless Chatbot for $0?

<PROGRAMMING/>

Page 22: How to Build a Serverless Chatbot for $0?

WHAT DO YOU NEED TO KNOW TO SETUP A CHATBOT

Page 23: How to Build a Serverless Chatbot for $0?

• Server • SSL • Setup API / Webhooks • Register app / bot • Setup tokens, webhook url, etc. • Write the logic • …

Page 24: How to Build a Serverless Chatbot for $0?
Page 25: How to Build a Serverless Chatbot for $0?

IS THERE A BETTER WAY?

Page 26: How to Build a Serverless Chatbot for $0?

YES, OF COURSE!

Page 27: How to Build a Serverless Chatbot for $0?

• Visual chatbot builders (Chatfuel) • Bot frameworks (Microsoft Bot Framework) • Amazon Lex • Many other options

Page 28: How to Build a Serverless Chatbot for $0?
Page 29: How to Build a Serverless Chatbot for $0?

BUILDING CHATBOTS IS NOT FUN, MOST OF THE TIME

AT LEAST, NOT AS MUCH AS IT SHOULD BE

Page 30: How to Build a Serverless Chatbot for $0?

WE DECIDED TO FIX THAT

AT LEAST, FOR US

Page 31: How to Build a Serverless Chatbot for $0?

MEET CLAUDIA BOT BUILDER

Page 32: How to Build a Serverless Chatbot for $0?

Claudia Bot Builder is an extension library for Claudia.js that helps you create bots

for 10 platforms.

Page 33: How to Build a Serverless Chatbot for $0?

The key idea behind the project is to remove all the boilerplate code and

common infrastructure tasks, so you can focus on writing the really important part

of the bot – your business workflows.

Page 34: How to Build a Serverless Chatbot for $0?
Page 35: How to Build a Serverless Chatbot for $0?

OK, LET ME SHOW YOU

Page 36: How to Build a Serverless Chatbot for $0?

var botBuilder = require('claudia-bot-builder')

module.exports = botBuilder(function(message) { return 'Hi there! You sent “' + message.text + '“'})

Page 37: How to Build a Serverless Chatbot for $0?

const botBuilder = require('claudia-bot-builder')

module.exports = botBuilder(message => `Hi there! You sent “${message.text}”`)

Page 38: How to Build a Serverless Chatbot for $0?

• AMAZON WEB SERVICES ACCOUNT • Node.js (version 4.3.2 is preferred) • Install Claudia and Claudia Bot Builder from NPM

PREREQUISITES

Page 39: How to Build a Serverless Chatbot for $0?

claudia create --region eu-central-1 --api-module bot

Page 40: How to Build a Serverless Chatbot for $0?

SIMPLY RUN ONE COMMAND TO DEPLOY THE BOT

Page 41: How to Build a Serverless Chatbot for $0?

TO SETUP DIFFERENT PLATFORMS

ADD ANOTHER FLAG

Page 42: How to Build a Serverless Chatbot for $0?

claudia create \ --region eu-central-1 \ --api-module bot \ --configure-fb-bot

Page 43: How to Build a Serverless Chatbot for $0?

ALL SUPPORTED PLATFORMS

Page 44: How to Build a Serverless Chatbot for $0?

• configure-fb-bot • configure-slack-slash-command • configure-slack-slash-app • configure-viber-bot • configure-telegram-bot • configure-skype-bot • configure-alexa-skill • configure-twilio-sms-bot • configure-kik-bot • configure-groupme-bot

Page 45: How to Build a Serverless Chatbot for $0?

LET’S SEE IT

Page 46: How to Build a Serverless Chatbot for $0?
Page 47: How to Build a Serverless Chatbot for $0?
Page 48: How to Build a Serverless Chatbot for $0?

HOW IT WORKS

Page 49: How to Build a Serverless Chatbot for $0?

zzz…

{ sender: { id: 12345 }, recipient: { id: 54321 }, timestamp: 1483413621558, message: { app_id: 999999, text: 'Hello' }}

{ recipient: { id: '12345' }, message: { text: 'Hi there' }}

{ sender: 12345, platform: ’facebook’, text: ‘Hello’, postback: false, originalRequest: {…}}

HelloHi there

Page 50: How to Build a Serverless Chatbot for $0?

PRICE

Page 51: How to Build a Serverless Chatbot for $0?
Page 52: How to Build a Serverless Chatbot for $0?

$0

Page 53: How to Build a Serverless Chatbot for $0?

AWS LAMBDA PRICING

• $0.20 per 1 million requests • $0.00001667 for every GB-second used • First million requests each month are free • First 400,000 GB-seconds are free

Page 54: How to Build a Serverless Chatbot for $0?

AWS LAMBDA IS STATELESS.

HOW DO WE SAVE THE STATE?

Page 55: How to Build a Serverless Chatbot for $0?

USE DYNAMO DB

Page 56: How to Build a Serverless Chatbot for $0?

IS THERE AN EASIER WAY TO BUILD COMPLEX

MESSAGES?

Page 57: How to Build a Serverless Chatbot for $0?

YES!

Page 58: How to Build a Serverless Chatbot for $0?

const botBuilder = require('claudia-bot-builder');const fbTemplate = botBuilder.fbTemplate;

module.exports = botBuilder(message => { if (message.type === 'facebook') { const newMessage = new fbTemplate.Text('What\'s your favorite House in Game Of Thrones');

return newMessage .addQuickReply('Stark', 'STARK') .addQuickReply('Lannister', 'LANNISTER') .addQuickReply('Targaryen', 'TARGARYEN') .addQuickReply('None of the above', 'OTHER') .get(); }});

Page 59: How to Build a Serverless Chatbot for $0?
Page 60: How to Build a Serverless Chatbot for $0?

CAN WE ADD NLP FOR $0 TOO?

Page 61: How to Build a Serverless Chatbot for $0?

YES OF COURSE, THERE’S A FEW OPTIONS:

Page 62: How to Build a Serverless Chatbot for $0?

• API.ai • Wit.ai • IBM Watson* • Luis.ai

Page 63: How to Build a Serverless Chatbot for $0?

EXAMPLES?

Page 64: How to Build a Serverless Chatbot for $0?

CLAUDIA.JS EXAMPLE PROJECTS:

GITHUB.COM/CLAUDIAJS/EXAMPLE-PROJECTS

Page 65: How to Build a Serverless Chatbot for $0?

SAMPLE BOTS:

Page 66: How to Build a Serverless Chatbot for $0?

SPACE EXPLORER FB BOT:

M.ME/SPACE.EXPLORER.BOTGITHUB.COM/STOJANOVIC/SPACE-EXPLORER-BOT

Page 67: How to Build a Serverless Chatbot for $0?
Page 68: How to Build a Serverless Chatbot for $0?

LAPTOP FRIENDLY VIBER BOT:

VIBER.COM/LAPTOPFRIENDLY GITHUB.COM/STOJANOVIC/LAPTOP-FRIENDLY-BOT

Page 69: How to Build a Serverless Chatbot for $0?
Page 70: How to Build a Serverless Chatbot for $0?

HOLYJS CONFERENCE BOT:

TELEGRAM.ME/HOLYJS_BOTGITHUB.COM/STOJANOVIC/HOLYJS-BOT

Page 71: How to Build a Serverless Chatbot for $0?
Page 72: How to Build a Serverless Chatbot for $0?

VACATION TRACKER FOR SLACK:

VACATIONTRACKERBOT.COM

Page 73: How to Build a Serverless Chatbot for $0?

VACATIONTRACKERBOT.COM

Page 74: How to Build a Serverless Chatbot for $0?

MORE INFO

Page 75: How to Build a Serverless Chatbot for $0?

CLAUDIAJS.COM

GITHUB.COM/CLAUDIAJS/CLAUDIA-BOT-BUILDER

Page 76: How to Build a Serverless Chatbot for $0?

WHAT’S NEXT?

Page 77: How to Build a Serverless Chatbot for $0?
Page 78: How to Build a Serverless Chatbot for $0?

QUESTIONS?

@SLOBODAN_

SLIDES: bit.ly/2kjaegq


Recommended