Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Chatterbot
Search
Tomohiro Taira
December 04, 2012
Programming
0
450
Chatterbot
I'm created the Kris. Kris is a Ruby IRC bot library.
https://github.com/Tomohiro/kris
Tomohiro Taira
December 04, 2012
Tweet
Share
More Decks by Tomohiro Taira
See All by Tomohiro Taira
Go Package Development
tomohiro
1
1.1k
Awesome LAMP
tomohiro
1
410
Other Decks in Programming
See All in Programming
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.2k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
340
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
16
4.1k
JaSST 24 九州:ワークショップ(は除く)実践!マインドマップを活用したソフトウェアテスト+活用事例
satohiroyuki
0
260
Golang と Erlang
taiyow
8
1.9k
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
570
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
170
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
440
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
140
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
240
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
110
Featured
See All Featured
Being A Developer After 40
akosma
86
590k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
Code Reviewing Like a Champion
maltzj
519
39k
GraphQLとの向き合い方2022年版
quramy
43
13k
What's in a price? How to price your products and services
michaelherold
243
12k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
290
RailsConf 2023
tenderlove
29
880
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
Designing for humans not robots
tammielis
249
25k
Transcript
Chatterbot Support your development team
@Tomohiro twitter.com/ github.com/ coderwall.com/
@Tomohiro ࢲͩ
@gongoZ ͝Μ͝͞Μͩ
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...) current: 4th!!
Chatterbot a.k.a ਓޱແೳ
Chatterbot A chatter robot, chatterbot, chatbot, or chat bot is
a computer program designed to simulate an intelligent conversation with one or more human users via auditory or textual methods, primarily for engaging in small talk. - via Wikipedia chatterbot
ਓޱແೳ ਓແʢ͡Μ͜͏Ήͷ͏ʣͱɺਓೳʹରԠ ͢Δ༻ޠͰɺӳޠݍͰDIBUUFSCPUɺ͘͠ DIBUCPUͱݺΕɺͦͷ༁ޠͱͯ͠ձϘοτ͋ Δ͍͓͠ΌΓϘοτͱݺΕΔ͜ͱ͕͋Δɻ 8JLJQFEJBਓޱແೳΑΓ
ਓޱೳ ϘτϜΞοϓతͳਓೳͷΞϓϩʔνͰʮਓΒ͠ ͞ʯʹ౸ୡ͢Δ·ͰͷಓͷΓ͕ԕ͍ͷͰɺτοϓμϯ తʹʮਓΒ͠͞ʯͷϞσϧΛ࡞Γ͜Ή͜ͱͰʮਓΒ͠ ͞ʯΛ࡞Γग़ͦ͏ͱ͢Δཱɻ͓ΑͼͦͷཱͰ࡞ΒΕ ͨγεςϜɾϞσϧɾιϑτΣΞͳͲΛࢦ͢ɻ 8JLJQFEJBਓޱແೳΑΓ
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl) And many
more !!
νʔϜͷ
20125݄HubotΛ࠾༻
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɹˠ؆୯ʹϓϥάΠϯ͕ॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɹˠ؆୯ʹϓϥάΠϯ͕ॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɹˠ؆୯ʹϓϥάΠϯ͕ॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍ ɹˠࣾωοτϫʔΫʹͭͳ͍͛ͨ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ 3VCZͰ ɹɹॻ͚ͦ͏ʂ
࡞Γ·ͨ͠ ઌि
Kris Pluggable, and very simple. https://github.com/Tomohiro/kris depend on ‘zircon’. Thanks
to @r7kamura
ࠓग़དྷΔ͜ͱ ✓ϓϩΩγڥԼͰಈ࡞ ✓ϓϥάΠϯͰػೳΛ૿ͤΔ ✗ϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ✓ΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ✓ԠػೳͱఆظൃݴػೳΛ࣋ͭ
kris example project /mybot/ |-- Gemfile ґଘؔΛॻ͘ |-- bot Bot
ىಈϓϩάϥϜ `-- plugin ϓϥάΠϯ༻σΟϨΫτϦ |-- foo.rb `-- bar.rb
Bootstrap #!/usr/bin/env ruby require ‘kris’ Kris::Session.new( :server => ‘chat.freenode.net’, :port
=> 6667, :channel => ‘#MyChannel’, :username => ‘KrisBot’ ).start
Plugin example # Hello ͱ͍͏ൃݴʹ Hello! ͱฦ͢Δྫ class Reply <
Kris::Plugin def response(message) if message.body =~ /^Hello/ notice(message.to, ‘Hello!’) end end end
Plugin example # 1͝ͱʹݱࡏ࣌ࠁΛͭͿ͘ class Timer < Kris::Plugin def notify
notice(@robot.channel, Time.now.to_s) sleep 60 end end
TODO ɾϥΠϒϥϦͷςετॻ͘ ɾϓϥάΠϯͷςετख๏Λཱ֬ ɾRubyGems.orgʹϦϦʔε͢Δ
͓·͚ - Heroku Ͱಈ͘Αฤ $ cd my-bot $ echo ‘bot:
bundle exec ruby bot’ > Procfile $ heroku create {my-bot-name} $ git commit -a -m ‘my bot on heroku’ $ git push heroku master $ heroku ps:scale bot=1
Any Questions?