Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Plugging in your Bot - An extensible bot framework for Drupal 8
Rafael Silva
April 25, 2017
Programming
1
100
Plugging in your Bot - An extensible bot framework for Drupal 8
Presentation at DrupalCon 2017 Baltimore
Rafael Silva
April 25, 2017
Tweet
Share
More Decks by Rafael Silva
See All by Rafael Silva
rfsbsb
0
48
rfsbsb
1
42
rfsbsb
0
85
rfsbsb
1
40
rfsbsb
1
37
Other Decks in Programming
See All in Programming
standfm
0
270
osyo
1
370
xrdnk
0
130
trajchevska
2
400
taoshotaro
1
370
nanimonodemonai
2
1.4k
hollodotme
1
120
mraible
PRO
0
330
jun0
3
700
bkuhlmann
4
260
hr01
0
1.7k
466548
0
160
Featured
See All Featured
dougneiner
55
5.4k
brianwarren
83
4.7k
holman
288
130k
thoeni
4
550
wjessup
338
16k
scottboms
251
11k
michaelherold
225
8.5k
yeseniaperezcruz
302
31k
62gerente
587
200k
ddemaree
274
31k
zakiwarfel
88
3.3k
mza
80
4.1k
Transcript
Plugging in your Bot An extensible bot framework for Drupal
8
Who we are & @rfsbsb @ezufelt
We build the right thing, fast. @myplanetHQ
PREMISES • This talk is not about AI • This
talk is about chatbots, Drupal and the end user • This talk is also about extending Drupal with plugins
WHAT ARE WE GOING TO COVER? • Chatbot overview •
Common use cases for chatbots • Current state of chatbots and Drupal • Our implementation • Demos • Future for chatbots and Drupal
What are chatbots?
A chatbot is a service, powered by rules and sometimes
artificial intelligence, that you interact with via a chat interface. “ Chatbot Magazine
Common use cases
EXAMPLES OF CHATBOTS • Weather/forecast (HiPoncho Facebook bot) • Survey
(Surveybot) • Todo list (Todobot) • News (CNN Facebook bot) • Catalog/buying options (Nordstrom bot) • Just chat (Xiaoice)
Chatbots and Drupal
CHATBOTS AND DRUPAL • Bot • AIML Parser • Facebook
Messenger Bot
Enter the Chatbot module
THE CHATBOT MODULE • Drupal 8 • Forked from Whitehouse’s
Facebook Messenger Bot module • It’s extensible through the Plugin API • Comes with 2 plugins: Facebook and Slack
COMPONENTS OF A CHATBOT • Message Type • Messages •
Steps • Workflows
Message Types Buttons Text Image Decision Video
Step
Workflow
DEMO
EXTENDING THE CHATBOT MODULE • You will implement a plugin
using Plugin API • Your message types • The service (i.e how to talk to your chat provider) • The workflow
A CHATBOT PLUGIN EXAMPLE /** * Facebook Chatbot implementation. *
* @ChatbotPlugin( * id = "chatbot_facebook", * title = @Translation("Facebook Chatbot") * ) */ class ChatbotFacebook extends ChatbotPluginBase implements ChatbotPluginInterface { … public function challenge() { return $this->service->challenge(); } public function parsePostData(Request $request) { return $request->getContent(); } }
DEMO II
FUTURE IMPROVEMENTS • There’s room for code refactoring • Add
new message types • Integration to AI services (Amazon Lex / IBM Watson / Microsoft Luis / wit.ai / api.ai)
#drupalsprints Friday, April 28, 2017 Mentored Core Sprint 9:00am-12:00pm Room:301-303
General Sprints 9:00am-6:00pm Room:309-310
THANK YOU! WHAT DID YOU THINK? Locate this session at
the DrupalCon Baltimore website: http://baltimore2017.drupal.org/schedule Take the survey https://www.surveymonkey.com/r/ drupalconbaltimore https://goo.gl/9s1OiM