Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to build a chatbot for $0

How to build a chatbot for $0

Presentation about building chatbots for Mobile Monday on February 6th.

Original keynote presentation contains gifs and animations, full keynote file is available here: https://dl.dropboxusercontent.com/u/63393755/Slobodan/presentations/how-to-build-a-chatbot-for-0-dollars-mobile-monday-2017-02-06.pdf

Slobodan Stojanović

February 06, 2017
Tweet

More Decks by Slobodan Stojanović

Other Decks in Programming

Transcript

  1. I’M SLOBODAN STOJANOVIC CTO OF CLOUD HORIZON JS BELGRADE MEETUP

    ORGANIZER GITHUB.COM/STOJANOVIC TWITTER.COM/SLOBODAN_
  2. 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.
  3. • 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)
  4. Hello { sender: { id: 12345 }, recipient: { id:

    54321 }, timestamp: 1483413621558, message: { app_id: 999999, text: 'Hello' } } { recipient: { id: '12345' }, message: { text: 'Hi there' } } Hi there
  5. • Server • SSL • Setup API / Webhooks •

    Register app / bot • Setup tokens, webhook url, etc. • Write the logic • …
  6. • Visual chatbot builders (Chatfuel) • Bot frameworks (Microsoft Bot

    Framework) • Amazon Lex •Many other options
  7. BUILDING CHATBOTS IS NOT FUN, MOST OF THE TIME AT

    LEAST, NOT AS MUCH AS IT SHOULD BE
  8. Claudia Bot Builder is an extension library for Claudia.js that

    helps you create bots for 10 platforms.
  9. 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.
  10. • AMAZON WEB SERVICES ACCOUNT • Node.js (version 4.3.2 is

    preferred) • Install Claudia and Claudia Bot Builder from NPM PREREQUISITES
  11. 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: {…} } Hello Hi there
  12. $0

  13. 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
  14. 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(); } });