SlideShare a Scribd company logo
1 of 40
Download to read offline
Let’s Get Chatty!
Building Serverless Slack Chatbot on IBM Cloud Functions
Serverless Dev Summit | July 26, 2019
@girlie_mac
Hello world!
Tomomi Imura
( @girlie_mac)
2
What Are Bots?
A bot is a software application that runs automated
tasks (scripts).
Typically, bots perform tasks that are both simple
and structurally repetitive, at a much higher rate
than would be possible for a human alone.
https://en.wikipedia.org/wiki/Internet_bot
@girlie_mac
Also, it is a user experience that can expose
services to users via conversational engagement
and rich interactions.
What Are Bots?
@girlie_mac
"Bots are like new applications
that you can converse with."
-- Satya Nadella, Microsoft (2016)
Future of computing revolves
around three principal factors:
● Humans
● Digital assistants
● Bots
Conversational User Interactions
Conversational User Interactions
Voice Assistance
Alexa, how is the
weather?
Hey Siri
@girlie_mac
Conversational User Interactions
Google Assistant (Voice & Text)
Hi, how can I help?
@girlie_mac
Conversational User Interactions
Bots on Chat Apps (Text)
!
@girlie_mac
Conversational Bots on Facebook Messanger
KLM Royal Dutch Airlines
BlueBot (BB)
On Facebook Messenger
Conversational Bots on Multiple Platforms
UPS Chatbot
On
● Facebook Messenger
● Skype
● Google Assistant
● Amazon Alexa
Conversational Bots on Slack
Geekbot
@girlie_mac
Conversational Bots on Slack
Taco Bot
https://www.tacobell.com/feed/tacobot@girlie_mac
Building A Conversational App on Slack
Example: A simple bot that responds to “Hi”
Hi
Hello
@girlie_mac
with Slack API
● Events API to listen to an event (message.im)
when a user sends a direct message to your bot
● When an event is triggered, receive a payload
to get a message text
● Use Web API method, chat.postMessage to
post a message on Slack
@girlie_mac
User DM a message
Sends payload to
request URL
USER Bot SLACK
chat.postMessage
Reply to
the user Hello
Hi
message.im
event is triggered
Process the
payload. Extract
the user’s
message & see if
the message
contains a word,
“Hi”
Chatbot with RegEx = Not so conversational
if(/hi/i.test(event.text)) {
reply(‘Hello’);
}
Hi
Hello
@girlie_mac
Make it Smarter with NLP
if(/hi/i.test(event.text)) {
reply(...);
}
Hi
I need help
Guide me
Show me the
floor map
@girlie_mac
What is Natural Language Processing?
Process and analyze natural language data to
make the interactions between computers &
human, artificial & natural languages possible
Conversational Bots & NLP
@girlie_mac
Using Watson Assistant
Watson Assistant makes it smarter!
Sends payload to
request URL
USER BOT SLACK
chat.postMessage
Reply to the
user
Hi here’s some info!
Show me office
directory!
WATSON
Extract user-sent
message & pass
Process & return
User DM a message
message.im
event is triggered
bot.js (Receive Slack events & Post message)
exports.handler = async function handler(params) {
const {challenge, event} = params;
await reply(event.channel, event.text);
return {statusCode: 200};
}
// Get a reply from Watson Assistant
const reply = async(channel, text) => {
const params = {
assistant_id: WATSON_ASSISTANT_ID,
input: { text: text }
};
const result = await assistant.message(params);
sendToSlack(channel, result.output.generic[0].text);
When DM is sent in Slack
Pass the message text from
the user to the function that
handles:
1. Get a reply message via
Watson API
2. Post it on Slack
Watson returns the response
Post the response to Slack
Going serverless
Why do you wanna go serverless?
1
Cost-effective
Lowerinfrastructure&
operationalcost
2
Scalable
From
prototypetoproduction
3
Sim
plefunctions
Sim
plifiedprogram
m
ingm
odel
@girlie_mac
IBM Cloud Functions
HTTP
User
Cloud
(IBM Cloud Functions)
Chatbot
(Slack App)
HTTP
API Gateway
IBM Watson
Assistant
@girlie_mac
IBM Cloud Functions - Create an Action
@girlie_mac
.
├── .env
├── index.js
├── bot.js
├── package.json
├── readme.md
└── node_modules
├── some_module
...
My Files
const botEndpoint = require('./bot');
module.exports = {
main: botEndpoint.handler
};
index.js
@girlie_mac
IBM Cloud CLI
tomomi: ~/dev/slack/ibm/slack-bot-watson (zsh)
> zip -r chatbot.zip *
> ibmcloud fn action create slack-chatbot chatbot.zip
--kind nodejs:10
@girlie_mac
Receiving HTTP Events
1
@girlie_mac
Expose API Endpoint to Create a Public URL
1
2
Click Create
Managed API
to open the
pop-up
3
Define the API
endpoint. Select
your Action.
4
@girlie_mac
Send Slack Events the URL
1
2
3
4
Go to Slack
Config page
Use the public
URL
@girlie_mac
Result
@girlie_mac
Source Code
Source code on GitHub:
https://github.com/girliemac/serverless-slack-watson
not yet,sorry!
@girlie_mac
Resources
★ Slack API Docs: https://api.slack.com
★ Slack events types: https://api.slack.com/events
★ Watson Assistant: https://cloud.ibm.com/docs/services/assistant
★ Watson Node SDK:
https://www.npmjs.com/package/watson-developer-cloud
★ IBM Cloud Functions: https://www.ibm.com/cloud/functions
★ Cloud Functions CLI:
https://cloud.ibm.com/docs/cloud-functions-cli-plugin
@girlie_mac
Slack x IBM Watson Webinar (Recorded)
https://www.crowdcast.io/e/online-meetup-build-a
@girlie_mac
You’re invited to Spec, a developer conference by Slack.
Learn more at slack.com/spec
Get 30% off registration with code -S19_SPC30
Thank you!
Tomomi Imura (@girlie_mac)

More Related Content

Similar to [2019 Serverless Summit] Building Serverless Slack Chatbot on IBM Cloud Functions

MINI PRC FINAL.pptx
MINI PRC FINAL.pptxMINI PRC FINAL.pptx
MINI PRC FINAL.pptxDatlaSravya1
 
Bot & AI - A Bot for Productivity
Bot & AI - A Bot for ProductivityBot & AI - A Bot for Productivity
Bot & AI - A Bot for ProductivityMarvin Heng
 
Webinar - Building a ChatBot using IBM Watson Conversation Service
Webinar - Building a ChatBot using IBM Watson Conversation ServiceWebinar - Building a ChatBot using IBM Watson Conversation Service
Webinar - Building a ChatBot using IBM Watson Conversation ServiceThirdEye Data
 
Chatbot development workshop with the Microsoft Bot Framework
Chatbot development workshop with the Microsoft Bot FrameworkChatbot development workshop with the Microsoft Bot Framework
Chatbot development workshop with the Microsoft Bot Frameworkgjuljo
 
Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...goodfriday
 
How Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft TeamsHow Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft TeamsMicrosoft Tech Community
 
How Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft TeamsHow Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft TeamsMicrosoft Tech Community
 
IRJET- An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...
IRJET-  	  An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...IRJET-  	  An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...
IRJET- An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...IRJET Journal
 
Final Project In Instant messaging app that also brings you the intel...
Final Project In Instant  messaging  app  that   also  brings  you  the intel...Final Project In Instant  messaging  app  that   also  brings  you  the intel...
Final Project In Instant messaging app that also brings you the intel...vinayh.vaghamshi _
 
Building apps for microsoft teams - aossg
Building apps for microsoft teams - aossgBuilding apps for microsoft teams - aossg
Building apps for microsoft teams - aossgJenkins NS
 
Future of the Web with Conversational Interface
Future of the Web with Conversational InterfaceFuture of the Web with Conversational Interface
Future of the Web with Conversational InterfaceTomomi Imura
 
A Review Comparative Analysis On Various Chatbots Design
A Review   Comparative Analysis On Various Chatbots DesignA Review   Comparative Analysis On Various Chatbots Design
A Review Comparative Analysis On Various Chatbots DesignCourtney Esco
 
Clever data building a chatbot from your database
Clever data building a chatbot from your databaseClever data building a chatbot from your database
Clever data building a chatbot from your databaseLuis Beltran
 
IRJET- Artificial Intelligence Based Chat-Bot
IRJET-  	  Artificial Intelligence Based Chat-BotIRJET-  	  Artificial Intelligence Based Chat-Bot
IRJET- Artificial Intelligence Based Chat-BotIRJET Journal
 
Bots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teamsBots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teamsJenkins NS
 
IRJET - A Web-based College Enquiry Chatbot using .Net and Dataset
IRJET - A Web-based College Enquiry Chatbot using .Net and DatasetIRJET - A Web-based College Enquiry Chatbot using .Net and Dataset
IRJET - A Web-based College Enquiry Chatbot using .Net and DatasetIRJET Journal
 
An Intelligent Career Counselling Bot A System for Counselling
An Intelligent Career Counselling Bot A System for CounsellingAn Intelligent Career Counselling Bot A System for Counselling
An Intelligent Career Counselling Bot A System for CounsellingIRJET Journal
 

Similar to [2019 Serverless Summit] Building Serverless Slack Chatbot on IBM Cloud Functions (20)

MINI PRC FINAL.pptx
MINI PRC FINAL.pptxMINI PRC FINAL.pptx
MINI PRC FINAL.pptx
 
Bot & AI - A Bot for Productivity
Bot & AI - A Bot for ProductivityBot & AI - A Bot for Productivity
Bot & AI - A Bot for Productivity
 
Final presentation on chatbot
Final presentation on chatbotFinal presentation on chatbot
Final presentation on chatbot
 
CHATBOT PPT-2.pptx
CHATBOT PPT-2.pptxCHATBOT PPT-2.pptx
CHATBOT PPT-2.pptx
 
Webinar - Building a ChatBot using IBM Watson Conversation Service
Webinar - Building a ChatBot using IBM Watson Conversation ServiceWebinar - Building a ChatBot using IBM Watson Conversation Service
Webinar - Building a ChatBot using IBM Watson Conversation Service
 
Chatbot development workshop with the Microsoft Bot Framework
Chatbot development workshop with the Microsoft Bot FrameworkChatbot development workshop with the Microsoft Bot Framework
Chatbot development workshop with the Microsoft Bot Framework
 
Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...Developing Interactive Applications Using Windows Live Robots, Activities, an...
Developing Interactive Applications Using Windows Live Robots, Activities, an...
 
ms_3.pdf
ms_3.pdfms_3.pdf
ms_3.pdf
 
How Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft TeamsHow Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft Teams
 
How Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft TeamsHow Zoom.ai is building the future of work on Microsoft Teams
How Zoom.ai is building the future of work on Microsoft Teams
 
IRJET- An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...
IRJET-  	  An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...IRJET-  	  An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...
IRJET- An Intelligent Behaviour Shown by Chatbot System for Banking in Ve...
 
Final Project In Instant messaging app that also brings you the intel...
Final Project In Instant  messaging  app  that   also  brings  you  the intel...Final Project In Instant  messaging  app  that   also  brings  you  the intel...
Final Project In Instant messaging app that also brings you the intel...
 
Building apps for microsoft teams - aossg
Building apps for microsoft teams - aossgBuilding apps for microsoft teams - aossg
Building apps for microsoft teams - aossg
 
Future of the Web with Conversational Interface
Future of the Web with Conversational InterfaceFuture of the Web with Conversational Interface
Future of the Web with Conversational Interface
 
A Review Comparative Analysis On Various Chatbots Design
A Review   Comparative Analysis On Various Chatbots DesignA Review   Comparative Analysis On Various Chatbots Design
A Review Comparative Analysis On Various Chatbots Design
 
Clever data building a chatbot from your database
Clever data building a chatbot from your databaseClever data building a chatbot from your database
Clever data building a chatbot from your database
 
IRJET- Artificial Intelligence Based Chat-Bot
IRJET-  	  Artificial Intelligence Based Chat-BotIRJET-  	  Artificial Intelligence Based Chat-Bot
IRJET- Artificial Intelligence Based Chat-Bot
 
Bots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teamsBots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teams
 
IRJET - A Web-based College Enquiry Chatbot using .Net and Dataset
IRJET - A Web-based College Enquiry Chatbot using .Net and DatasetIRJET - A Web-based College Enquiry Chatbot using .Net and Dataset
IRJET - A Web-based College Enquiry Chatbot using .Net and Dataset
 
An Intelligent Career Counselling Bot A System for Counselling
An Intelligent Career Counselling Bot A System for CounsellingAn Intelligent Career Counselling Bot A System for Counselling
An Intelligent Career Counselling Bot A System for Counselling
 

More from Tomomi Imura

ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)
ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)
ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)Tomomi Imura
 
[POST.Dev Japan] VS Code で試みる開発体験の向上
[POST.Dev Japan] VS Code で試みる開発体験の向上[POST.Dev Japan] VS Code で試みる開発体験の向上
[POST.Dev Japan] VS Code で試みる開発体験の向上Tomomi Imura
 
[Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう!
[Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう![Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう!
[Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう!Tomomi Imura
 
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
[#DevRelAsia Keynote 2020] Developer Centric Design for Better ExperienceTomomi Imura
 
Engineering career is not a single ladder! - Alternative pathway to develope...
Engineering career is not a single ladder!  - Alternative pathway to develope...Engineering career is not a single ladder!  - Alternative pathway to develope...
Engineering career is not a single ladder! - Alternative pathway to develope...Tomomi Imura
 
Being a Tech Speaker with Global Mindset
Being a Tech Speaker with Global MindsetBeing a Tech Speaker with Global Mindset
Being a Tech Speaker with Global MindsetTomomi Imura
 
#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)
#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)
#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)Tomomi Imura
 
Slack × Twilio - Uniquely Powering Communication
Slack × Twilio - Uniquely Powering CommunicationSlack × Twilio - Uniquely Powering Communication
Slack × Twilio - Uniquely Powering CommunicationTomomi Imura
 
[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block Kit[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block KitTomomi Imura
 
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...Tomomi Imura
 
Building a Bot with Slack Platform and IBM Watson
Building a Bot with Slack Platform and IBM WatsonBuilding a Bot with Slack Platform and IBM Watson
Building a Bot with Slack Platform and IBM WatsonTomomi Imura
 
[日本語] Slack Bot Workshop + Intro Block Kit
[日本語] Slack Bot Workshop + Intro Block Kit[日本語] Slack Bot Workshop + Intro Block Kit
[日本語] Slack Bot Workshop + Intro Block KitTomomi Imura
 
[DevRelCon Tokyo 2019] Developer Experience Matters
[DevRelCon Tokyo 2019] Developer Experience Matters [DevRelCon Tokyo 2019] Developer Experience Matters
[DevRelCon Tokyo 2019] Developer Experience Matters Tomomi Imura
 
[DevRel Summit 2018] Because we all learn things differently
[DevRel Summit 2018] Because we all learn things differently[DevRel Summit 2018] Because we all learn things differently
[DevRel Summit 2018] Because we all learn things differentlyTomomi Imura
 
[DevRelCon July 2018] Because we all learn things differently
[DevRelCon July 2018] Because we all learn things differently[DevRelCon July 2018] Because we all learn things differently
[DevRelCon July 2018] Because we all learn things differentlyTomomi Imura
 
[Japanese] Developing a bot for your workspace 翻訳ボットを作る!
[Japanese] Developing a bot for your workspace 翻訳ボットを作る![Japanese] Developing a bot for your workspace 翻訳ボットを作る!
[Japanese] Developing a bot for your workspace 翻訳ボットを作る!Tomomi Imura
 
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi [Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi Tomomi Imura
 
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...Tomomi Imura
 
[日本語・Japanese] Creative Technical Content for Better Developer Experience
[日本語・Japanese] Creative Technical Content for Better Developer Experience[日本語・Japanese] Creative Technical Content for Better Developer Experience
[日本語・Japanese] Creative Technical Content for Better Developer ExperienceTomomi Imura
 
Notice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical ContentNotice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical ContentTomomi Imura
 

More from Tomomi Imura (20)

ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)
ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)
ECMeowScript - What's New in JavaScript Explained with Cats (August 14th, 2020)
 
[POST.Dev Japan] VS Code で試みる開発体験の向上
[POST.Dev Japan] VS Code で試みる開発体験の向上[POST.Dev Japan] VS Code で試みる開発体験の向上
[POST.Dev Japan] VS Code で試みる開発体験の向上
 
[Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう!
[Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう![Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう!
[Japan M365 Dev UG] Teams Toolkit v4 を使ってみよう!
 
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
 
Engineering career is not a single ladder! - Alternative pathway to develope...
Engineering career is not a single ladder!  - Alternative pathway to develope...Engineering career is not a single ladder!  - Alternative pathway to develope...
Engineering career is not a single ladder! - Alternative pathway to develope...
 
Being a Tech Speaker with Global Mindset
Being a Tech Speaker with Global MindsetBeing a Tech Speaker with Global Mindset
Being a Tech Speaker with Global Mindset
 
#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)
#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)
#TinySpec2019 Slack Dev Meetup in Osaka & Tokyo (in Japanese)
 
Slack × Twilio - Uniquely Powering Communication
Slack × Twilio - Uniquely Powering CommunicationSlack × Twilio - Uniquely Powering Communication
Slack × Twilio - Uniquely Powering Communication
 
[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block Kit[2019 south bay meetup] Building more contextual message with Block Kit
[2019 south bay meetup] Building more contextual message with Block Kit
 
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
 
Building a Bot with Slack Platform and IBM Watson
Building a Bot with Slack Platform and IBM WatsonBuilding a Bot with Slack Platform and IBM Watson
Building a Bot with Slack Platform and IBM Watson
 
[日本語] Slack Bot Workshop + Intro Block Kit
[日本語] Slack Bot Workshop + Intro Block Kit[日本語] Slack Bot Workshop + Intro Block Kit
[日本語] Slack Bot Workshop + Intro Block Kit
 
[DevRelCon Tokyo 2019] Developer Experience Matters
[DevRelCon Tokyo 2019] Developer Experience Matters [DevRelCon Tokyo 2019] Developer Experience Matters
[DevRelCon Tokyo 2019] Developer Experience Matters
 
[DevRel Summit 2018] Because we all learn things differently
[DevRel Summit 2018] Because we all learn things differently[DevRel Summit 2018] Because we all learn things differently
[DevRel Summit 2018] Because we all learn things differently
 
[DevRelCon July 2018] Because we all learn things differently
[DevRelCon July 2018] Because we all learn things differently[DevRelCon July 2018] Because we all learn things differently
[DevRelCon July 2018] Because we all learn things differently
 
[Japanese] Developing a bot for your workspace 翻訳ボットを作る!
[Japanese] Developing a bot for your workspace 翻訳ボットを作る![Japanese] Developing a bot for your workspace 翻訳ボットを作る!
[Japanese] Developing a bot for your workspace 翻訳ボットを作る!
 
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi [Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
 
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
 
[日本語・Japanese] Creative Technical Content for Better Developer Experience
[日本語・Japanese] Creative Technical Content for Better Developer Experience[日本語・Japanese] Creative Technical Content for Better Developer Experience
[日本語・Japanese] Creative Technical Content for Better Developer Experience
 
Notice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical ContentNotice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical Content
 

Recently uploaded

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfrs7054576148
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 

[2019 Serverless Summit] Building Serverless Slack Chatbot on IBM Cloud Functions

  • 1. Let’s Get Chatty! Building Serverless Slack Chatbot on IBM Cloud Functions Serverless Dev Summit | July 26, 2019
  • 3. What Are Bots? A bot is a software application that runs automated tasks (scripts). Typically, bots perform tasks that are both simple and structurally repetitive, at a much higher rate than would be possible for a human alone. https://en.wikipedia.org/wiki/Internet_bot @girlie_mac
  • 4. Also, it is a user experience that can expose services to users via conversational engagement and rich interactions. What Are Bots? @girlie_mac
  • 5. "Bots are like new applications that you can converse with." -- Satya Nadella, Microsoft (2016)
  • 6. Future of computing revolves around three principal factors: ● Humans ● Digital assistants ● Bots
  • 8. Conversational User Interactions Voice Assistance Alexa, how is the weather? Hey Siri @girlie_mac
  • 9. Conversational User Interactions Google Assistant (Voice & Text) Hi, how can I help? @girlie_mac
  • 10. Conversational User Interactions Bots on Chat Apps (Text) ! @girlie_mac
  • 11. Conversational Bots on Facebook Messanger KLM Royal Dutch Airlines BlueBot (BB) On Facebook Messenger
  • 12. Conversational Bots on Multiple Platforms UPS Chatbot On ● Facebook Messenger ● Skype ● Google Assistant ● Amazon Alexa
  • 13. Conversational Bots on Slack Geekbot @girlie_mac
  • 14. Conversational Bots on Slack Taco Bot https://www.tacobell.com/feed/tacobot@girlie_mac
  • 16. Example: A simple bot that responds to “Hi” Hi Hello @girlie_mac
  • 17. with Slack API ● Events API to listen to an event (message.im) when a user sends a direct message to your bot ● When an event is triggered, receive a payload to get a message text ● Use Web API method, chat.postMessage to post a message on Slack @girlie_mac
  • 18. User DM a message Sends payload to request URL USER Bot SLACK chat.postMessage Reply to the user Hello Hi message.im event is triggered Process the payload. Extract the user’s message & see if the message contains a word, “Hi”
  • 19. Chatbot with RegEx = Not so conversational if(/hi/i.test(event.text)) { reply(‘Hello’); } Hi Hello @girlie_mac
  • 20. Make it Smarter with NLP if(/hi/i.test(event.text)) { reply(...); } Hi I need help Guide me Show me the floor map @girlie_mac
  • 21. What is Natural Language Processing? Process and analyze natural language data to make the interactions between computers & human, artificial & natural languages possible Conversational Bots & NLP @girlie_mac
  • 23. Watson Assistant makes it smarter!
  • 24. Sends payload to request URL USER BOT SLACK chat.postMessage Reply to the user Hi here’s some info! Show me office directory! WATSON Extract user-sent message & pass Process & return User DM a message message.im event is triggered
  • 25. bot.js (Receive Slack events & Post message) exports.handler = async function handler(params) { const {challenge, event} = params; await reply(event.channel, event.text); return {statusCode: 200}; } // Get a reply from Watson Assistant const reply = async(channel, text) => { const params = { assistant_id: WATSON_ASSISTANT_ID, input: { text: text } }; const result = await assistant.message(params); sendToSlack(channel, result.output.generic[0].text); When DM is sent in Slack Pass the message text from the user to the function that handles: 1. Get a reply message via Watson API 2. Post it on Slack Watson returns the response Post the response to Slack
  • 27. Why do you wanna go serverless? 1 Cost-effective Lowerinfrastructure& operationalcost 2 Scalable From prototypetoproduction 3 Sim plefunctions Sim plifiedprogram m ingm odel @girlie_mac
  • 28. IBM Cloud Functions HTTP User Cloud (IBM Cloud Functions) Chatbot (Slack App) HTTP API Gateway IBM Watson Assistant @girlie_mac
  • 29. IBM Cloud Functions - Create an Action @girlie_mac
  • 30. . ├── .env ├── index.js ├── bot.js ├── package.json ├── readme.md └── node_modules ├── some_module ... My Files const botEndpoint = require('./bot'); module.exports = { main: botEndpoint.handler }; index.js @girlie_mac
  • 31. IBM Cloud CLI tomomi: ~/dev/slack/ibm/slack-bot-watson (zsh) > zip -r chatbot.zip * > ibmcloud fn action create slack-chatbot chatbot.zip --kind nodejs:10 @girlie_mac
  • 33. Expose API Endpoint to Create a Public URL 1 2 Click Create Managed API to open the pop-up 3 Define the API endpoint. Select your Action. 4 @girlie_mac
  • 34. Send Slack Events the URL 1 2 3 4 Go to Slack Config page Use the public URL @girlie_mac
  • 36. Source Code Source code on GitHub: https://github.com/girliemac/serverless-slack-watson not yet,sorry! @girlie_mac
  • 37. Resources ★ Slack API Docs: https://api.slack.com ★ Slack events types: https://api.slack.com/events ★ Watson Assistant: https://cloud.ibm.com/docs/services/assistant ★ Watson Node SDK: https://www.npmjs.com/package/watson-developer-cloud ★ IBM Cloud Functions: https://www.ibm.com/cloud/functions ★ Cloud Functions CLI: https://cloud.ibm.com/docs/cloud-functions-cli-plugin @girlie_mac
  • 38. Slack x IBM Watson Webinar (Recorded) https://www.crowdcast.io/e/online-meetup-build-a @girlie_mac
  • 39. You’re invited to Spec, a developer conference by Slack. Learn more at slack.com/spec Get 30% off registration with code -S19_SPC30
  • 40. Thank you! Tomomi Imura (@girlie_mac)