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
ビールを飲みに行きたくなるスピーカーアプリ / API Meetup Tokyo #24
Search
misoca12
February 23, 2018
Programming
1
370
ビールを飲みに行きたくなるスピーカーアプリ / API Meetup Tokyo #24
misoca12
February 23, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.9k
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
110
役立つログに取り組もう
irof
28
9.2k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
420
色々なIaCツールを実際に触って比較してみる
iriikeita
0
310
CSC509 Lecture 09
javiergs
PRO
0
130
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
490
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
160
C++でシェーダを書く
fadis
6
3.8k
gopls を改造したら開発生産性が高まった
satorunooshie
8
270
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
140
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
700
Featured
See All Featured
Music & Morning Musume
bryan
46
6.2k
Designing for humans not robots
tammielis
249
25k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
KATA
mclloyd
29
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Designing the Hi-DPI Web
ddemaree
280
34k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
108
49k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Ruby is Unlike a Banana
tanoku
96
11k
Transcript
ϏʔϧΛҿΈʹߦ͖ͨ͘ͳΔ εϐʔΧʔΞϓϦ API Meetup Tokyo #24 Takuya Kimura @misoca12
ࣗݾհ • Ͳ͔͜Ͱฉ͍ͨ͜ͱ͋Δ໊લ • ීஈAndroidΞϓϦΛ։ൃ • ΫϥϑτϏʔϧ͕͖ ଜ Takuya Kimura
@misoca12
ͭͬͨ͘ͷ ΠΧεςʔδ ήʔϜͷεςʔδใΛऔಘ͢Δ Google Assistant͚ΞϓϦ BeerHolicTokyo(ϕʔλ൛) ϏʔϧͷใΛߘͨ͠Γۙ͘ͷ ϏΞόʔΛݕࡧ͢ΔAndroid͚ΞϓϦ
ࠓൃද͢Δ͜ͱ ΫϥϑτϏʔϧͷใΛڭ͑ͯ͘ΕΔ GoogleAssistant͚ΞϓϦΛ࡞ͬͨ
ΫϥϑτϏʔϧͱ খنͳϒϧϫϦʔ(ৢॴ)Ͱ࡞Γख͕ ࣭Λॏࢹ͠ɺͩ͜ΘΓΛ࣋ͬͯख࡞Γ ͨ͠(Ϋϥϑτ)Ϗʔϧͷ͜ͱɻ
ΫϥϑτϏʔϧͱ খنͳϒϧϫϦʔ(ৢॴ)Ͱ࡞Γख͕ ࣭Λॏࢹ͠ɺͩ͜ΘΓΛ࣋ͬͯख࡞Γ ͨ͠(Ϋϥϑτ)Ϗʔϧͷ͜ͱɻ • छྨ͕ଟ͍ ϒϧϫϦʔຊͰ300Ҏ্ΞϝϦΧͰ5000Ҏ্ • ྲྀ௨ྔ͕গͳ͍ قઅݶఆҰ͔͠ੜ࢈͞Εͳ͍ͷଟ͍
ΫϥϑτϏʔϧͷϝχϡʔ
ΫϥϑτϏʔϧͷϝχϡʔ TAPʢϏʔϧͷ͗ޱʣ= ੜϏʔϧ
ۙͷϏΞόʔࣄ ҿΈʹ ߦ͖͍ͨ
ۙͷϏΞόʔࣄ ྲྀಈతͳใ
ۙͷϏΞόʔࣄ ྲྀಈతͳใ ෳͷ4/4ʹ ࢄ͍ͯ͠Δ
None
࣮ࡍʹ࡞ͬͯΈͨ
None
“What’s on tap?” ͲΜͳੜϏʔϧ͕͋Γ·͔͢ʁ
֓ཁ ΫϥϑτϏʔϧఏڙऀ(ϏΞόʔ)͕ొͨ͠ λοϓใΛڭ͑ͯ͘ΕΔGoogle AssistantΞϓϦɻ
֓ཁ ΫϥϑτϏʔϧఏڙऀ(ϏΞόʔ)͕ొͨ͠ λοϓใΛڭ͑ͯ͘ΕΔGoogle AssistantΞϓϦɻ • Ͳͷ͓ళͰͲͷΑ͏ͳϏʔϧ͕ఏڙ͞Ε͍ͯΔ͔ ͷใ͕औಘͰ͖Δ • ఏڙ͞Ε͍ͯΔϏʔϧʹਵ͢Δใऔಘ͢ Δ͜ͱ͕Ͱ͖Δ
ߏ AndroidΞϓϦ AssistantΞϓϦ Firebase
AndroidΞϓϦʙ֓ཁʙ • ΫϥϑτϏʔϧఏڙళฮ͕ར༻͢Δ ͜ͱΛఆ • ݱࡏͷλοϓใΛొ͢Δ
AndroidΞϓϦʙϩάΠϯʙ
AndroidΞϓϦʙϢʔβొʙ
AndroidΞϓϦʙϢʔβొޙʙ
AndroidΞϓϦʙϢʔβొޙʙ
AndroidΞϓϦʙλοϓొʙ
AndroidΞϓϦʙλοϓҰཡʙ
AndroidΞϓϦʙλοϓҰཡʙ
AndroidΞϓϦʙͬͯΔ͜ͱʙ ϩάΠϯ Ϣʔβొ λοϓొ
AssistantΞϓϦʙ֓ཁʙ • ΫϥϑτϏʔϧΛҿΈ͍ͨਓ͕ར༻ ͢Δ͜ͱΛఆ • ళฮຖʹొ͞Ε͍ͯΔλοϓใ Λऔಘ͢Δ
AssistantΞϓϦʙॲཧϑϩʔʙ Webhook
AssistantΞϓϦʙݺͼग़͠ʙ
AssistantΞϓϦʙλοϓҰཡʙ
AssistantΞϓϦʙλοϓৄࡉʙ
It worked!
TIPS
Dialogflowͱ ࣗવݴޠॲཧΛ؆୯ʹ࣮Ͱ͖ΔαʔϏεɻ • Intent ݅Λຬͨͨ࣌͠ʹͲ͏ৼΔ͏͔ͱ͍͏ ग़དྷࣄͷఆٛɻ • Entity ࣗવݴޠͷத͔Βநग़͢ΔΩʔϫʔυɻ
Require Parameter Intentʹͬͯ͘ΔύϥϝʔλΛඞਢԽ͢Δ͜ͱ ͰඞཁͳύϥϝʔλΛऩूͯ͘͠ΕΔɻ
User Entity Placeͱ͍͏EntityʹAPI Meetup TokyoΛొ͢ Δ͜ͱͰDialogflowͰళฮͱೝࣝ͞ΕΔɻ
User Entity ొ͠ͳ͍ͱ ొ͢Δͱ UserEntityొAPI͕༻ҙ͞Ε͍ͯΔɻ POST /entities POST /entities/{id}/entries
Contexts IntentͷؔΛঢ়ଶͱͯ͠ఆٛ͢Δɻ ໊લ͖ύϥϝʔλΛ༩͢Δ͜ͱՄೳɻ • input contextIntentͷൃੜ݅ • output context࣍ͷIntentͷൃੜ݅ Webhook͔ΒઃఆՄೳɻ
FollowupEvent Intentͷൃੜ݅ͱͯ͠Event͕͋Δɻ Webhook͔ΒFollowupEventͱͯ͠Πϕϯτ໊ Λฦ٫͢Δ͜ͱͰผͷIntentΛൃੜͤ͞Δ͜ͱ͕ Ͱ͖ΔɻʢϦμΠϨΫτతͳ͍ํʣ
Webhook Timeout Webhookͨ͠߹5ඵҎʹϨεϙϯε͕ͳ͍ͱλΠϜΞτͱ ͳΓɺΞϓϦ͕ऴྃ͢Δɻ Deploy Fulfillment https://developers.google.com/actions/dialogflow/deploy-fulfillment Cloud FunctionʹҰఆ࣌ؒϦΫΤετ͕ͳ͍ͱεϦʔϓϞʔυʹೖ Γɺ෮ؼ·Ͱඵ͔͔ΔͷͰҙɻ
։ൃڥͰcloud functions(firebase)ͷಈ࡞͕͍ཧ༝ https://qiita.com/Masaaki/items/54cf16c6c55cdae91b82
εϐʔΧʔҎ֎ͷߟྀ
ΞϓϦ໊ͷೝࣝ ຊޠ൛GoogleAssistantͰجຊతʹӳޠͳͲ ຊޠʹม͞ΕΔɻ ֯εϖʔε͕ೖ͍ͬͯΔ
ಡΈํ͕ҧ͏ ࢥͬͨ௨ΓʹಡΜͰ͘Εͳ͍͜ͱ͕͋Δɻ API Meetup → ΞϐʔϛʔτΞοϓ ࣈͷಡΈո͍͠߹͕͋Δɻ ͻΒ͕ͳΧλΧφʹ͢Δ͜ͱͰճආՄೳɻ
ࠓޙͷ༧ఆ Whats on Tap ΛͬͯΈ͍ͨళฮืूதʂ ڠྗͯ͠Β͑Δళฮʹࢼݧಋೖ͠ɺ ϦϦʔεʹ͚ͯௐ༧ఆɻ
Have a nice beer life!