$30 off During Our Annual Pro Sale. View Details »

Googleアシスタントアプリの基本からマルチデバイス対応まで

1coin
February 09, 2019

 Googleアシスタントアプリの基本からマルチデバイス対応まで

Android Bazaar&Conference,Diverse 2019 浜松 での登壇資料です。

- https://jaghama.connpass.com/event/112489/?fbclid=IwAR1UbkGR1Fdq5eOwy469wmoQXq6igCBVYxiPozrKVYZlsxYbHWuXrEIU7Ao

1coin

February 09, 2019
Tweet

More Decks by 1coin

Other Decks in Technology

Transcript

  1. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    D D 9B9 Google CD H AD 0 21 2 0 10 2 0 2 10
  2. U .. 5 3 6 2K G 6 5 2IS

    1 4 2D  Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  3.  Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. 

    
  4. . . : sakf : : : @ .:. A

    : A @ . . G G Not EbnCM . . . . ) ( r S hDP _N m : gcNhpi C ( ( V V e TV gcdl C Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. B
  5. 1 7 87 8 8 : 8 S IC J

    E@ ( ( 1 1 () T T E C S Y a A S Y G cE@!!! Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.
  6.   Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

     
  7. . . • a A G I • a e

    • • • • . Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. VT c
  8. . , Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

  9.       Copyright (C) 2019 Namito.Satoyama,

    Shinji.Ichien All Rights Reserved. 
  10.      Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien

    All Rights Reserved. 
  11.       Copyright (C) 2019 Namito.Satoyama,

    Shinji.Ichien All Rights Reserved. 
  12.        Copyright (C) 2019

    Namito.Satoyama, Shinji.Ichien All Rights Reserved. 
  13. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. 3 n

    • • n G
  14. . / . . Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All

    Rights Reserved. = : ?
  15.   Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

     
  16. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    Google 8 : 8 9 8 9 8 35 . 3 1 1 20 4 /
  17. /. , // ON Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All

    Rights Reserved. , // G . / // A G //
  18. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    Smart Clock / Preview of Google Assistant Connect n 0 1 A -: 29 / : a c gSr s 0 1 A -: 29 7 A1 A - 2A r i G G6AA 9 A17 C1A26 7 2 3 2 A 2 ( ) 6A : n 7 A1 A - 2A n w koegj mE / : a c gS v dekt E G l heg S . : 9 kp
  19. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    KitchenAid Smart Display https://robotstart.info/2019/01/07/kitchenaid-smart-display.html n T 5 5 P 5 G n 5 n Y n IA I X Y
  20. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    https://www.sonos.com/ja-jp/shop/beam.html Google Assistant coming to Sonos One & Sonos Beam n 1 012 n 9
  21. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  Google

    Assistant coming to more TV devices n    n   n   n    n   https://www.blog.google/products/assistant/coming-soon-google-assistant-android-tv-and-more/ n    https://goo.gl/b5eLGE
  22.   Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

     
  23. eb )( )( )) ) • N j eb N

    F • W ld S j WW • • o N F • W o or oa • • . • W G • . j g • . Copyright (C) 2018 Namito.Satoyama, Shinji.Ichien All Rights Reserved. i s Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. i s
  24.   G GJ G S G P F A

    AC Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  25.    () G GJ G P G S

    F A AC Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  26.    ( ) G G A PG S

    G CJ F C FPG Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  27.    ( ) JP AC J JP AC

    A S JP AC I G FG Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  28. SGC   (  ) A P SGC D

    GC e SGC d f e f F I AF I f b bca J Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  29.   I G C I G F I ic

    I G ic DS P egd LJ b C J ea Af Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  30. • D JN r • . C G O J

    Di D soC • .D S • • aec b • ULI . • . C A Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. l g nf !
  31.   • kwpsjwod0HKQ 2QJ PEKJ 2K 2E A A

    c ! KKCHA /LL 1JCEJA /1! / : 7 • 4 8ulkmoqwptWi a ! KKCHA y nwrv /1 / : 7 ! h g " PPL . CEP Q K PEKJ KJ CKKCHA E HKC HKS SA KKG KEHA LH PA F • 6KPHEJ g ! 9EEP d ebfe PPL . EEP K KEJ , EPA , - - - (() A A /K 0HEAJP 7E T K 6KPHEJd Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.
  32. 31 3. 1 dD B C Copyright (C) 2018 Namito.Satoyama.

    All Rights Reserved. ib nlf • W A • npm install actions-on-google --save • npm install firebase-functions --save Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. ib nlf const { dialogflow } = require('actions-on-google') const functions = require('firebase-functions') const app = dialogflow() exports.endpoint = functions.https.onRequest(app) app.intent( '1 1 / 1 1 , conv => { conv.ask( Gja L c N ID ) }) app.intent( 1 , conv => { conv.close( c em I ) })
  33. Copyright (C) 2018 Namito.Satoyama. All Rights Reserved. st iA y

    p • d Bc • npm install actions-on-google --save • npm install firebase-functions --save • el fLWr d c DialogflowApp a mi Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. st iA y p 3 3. 2 n C D const { dialogflow } = require('actions-on-google') const functions = require('firebase-functions') const app = dialogflow() exports.endpoint = functions.https.onRequest(app) app.intent( ' 2 / , conv => { conv.ask( b uj Gl IN ) }) app.intent( , conv => { conv.close( el o L ) })
  34. Copyright (C) 2018 Namito.Satoyama. All Rights Reserved. yomCu t •

    g Df • npm install actions-on-google --save • npm install firebase-functions --save • p iN wl bgaf A DialogflowApp d m • ' 3 I iN wl (.. ,/ ,/ ,/ ,/ ! ) , ! => I conv.ask conv.close ces Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. yomCu t const { dialogflow } = require('actions-on-google') const functions = require('firebase-functions') const app = dialogflow() exports.endpoint = functions.https.onRequest(app) app.intent( ' / , conv => { conv.ask( ce n W B Ip LG ) }) app.intent( , conv => { conv.close( p s WNBL ) }) . + rGj
  35. 3 1 /3 3 1 I " Copyright (C) 2018

    Namito.Satoyama. All Rights Reserved. a d class ConversationComponentsApp : DialogflowApp() { @ForIntent("Default Welcome Intent") fun welcome(request: ActionRequest): ActionResponse { val responseBuilder = getResponseBuilder(request) responseBuilder .add( b CJC CGA ) return responseBuilder.build() } @ForIntent("Good Bye") fun goodBye(request: ActionRequest): ActionResponse { val responseBuilder = getResponseBuilder(request) responseBuilder .add( CJ K HL ) .endConversation() return responseBuilder.build() } } Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. a d 3 1 • DialogflowApp efC 1
  36. 32/ 2 32 rAi " Copyright (C) 2018 Namito.Satoyama. All

    Rights Reserved. w n t class ConversationComponentsApp : DialogflowApp() { @ForIntent("Default Welcome Intent") fun welcome(request: ActionRequest): ActionResponse { val responseBuilder = getResponseBuilder(request) responseBuilder .add( aeDylH HJ CoH KGA ) return responseBuilder.build() } @ForIntent("Good Bye") fun goodBye(request: ActionRequest): ActionResponse { val responseBuilder = getResponseBuilder(request) responseBuilder .add( go H I G ) .endConversation() return responseBuilder.build() } } • DialogflowApp H / 3/ d • ForIntent f 2 3 3 / b L Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. w n t 32 @ForIntent(“Intent ”) fun method(request: ActionRequest): ActionResponse { // go I v } !
  37. " 3 / 3 w Copyright (C) 2018 Namito.Satoyama. All

    Rights Reserved. n y class ConversationComponentsApp : DialogflowApp() { @ForIntent("Default Welcome Intent") fun welcome(request: ActionRequest): ActionResponse { val responseBuilder = getResponseBuilder(request) responseBuilder .add( bfC oG GI rG DJ ) return responseBuilder.build() } @ForIntent("Good Bye") fun goodBye(request: ActionRequest): ActionResponse { val responseBuilder = getResponseBuilder(request) responseBuilder .add( r G H A ) .endConversation() return responseBuilder.build() } } • DialogflowApp G 3 3 3 e • ForIntent a dg / 3 3 L • ResponseBuilder e wK v l • add(text: String) • add(simpleResponse: SimpleResponse) • add(image: Image) • endConversation() ! bf H Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. n y 3 @ForIntent(“Intentt”) fun method(request: ActionRequest): ActionResponse { // r iH } ! !
  38.    Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights

    Reserved.  
  39. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

      n G • T H • T H V • T
  40. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    Multimodal Spectrum n // . GQ D Q n QG MQ : J / . /
  41. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    n : D M Q : X J     ./ .
  42. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    n M D : J D     ./ .
  43. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    n h k Me D aQ J Db :     ./ . X ZD X
  44. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    n Q:J : V C Z M: a . D X Google    /
  45. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    Google    . n . / .: D
  46. Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  

    Google    ./ . n M J :D → → → → → →
  47.   Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

     
  48. /  Copyright (C) 2018 Namito.Satoyama. All Rights Reserved. 

     u tr o i gC a s CA 2 S fcC R e S 2 1 fc lv S 2 2 . 2- Surface lvC a S 2 2 2 . 2- Surfacep hA Sb mn S 2 2 M Surfacep hA Sb mn S Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  49. ) )      !  •

    ( • )) • )( • E ) ) : S A Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.
  50. • 4B A B D ajh • I 4 BD

    C B AC 4 4 B AG A A 4 Copyright (C) 2018 Namito.Satoyama. All Rights Reserved. ij _Egonf const hasScreen = conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT'); const hasAudio = conv.surface.capabilities.has('actions.capability.AUDIO_OUTPUT'); const hasMediaPlayback = conv.surface.capabilities.has('actions.capability.MEDIA_RESPONSE_AUDIO'); const hasWebBrowser = conv.surface.capabilities.has('actions.capability.WEB_BROWSER'); #  if (hasScreen) { conv.ask("  "); } else { conv.close("  "); };       eb ml TMLO S R c N PW U Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. ij _Egonf A
  51. •   • Copyright (C) 2018 Namito.Satoyama. All Rights

    Reserved. C I Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. C I
  52. Copyright (C) 2018 Namito.Satoyama. All Rights Reserved. nob lr -

    : • p c R m af M t • S ) ( ( / ! ? M uv s ie https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Shiba_Inu.jpg/250px-Shiba_Inu.jpg Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. nob lr
  53. - : Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

  54. - : • M Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All

    Rights Reserved.
  55. )82 1 8 0 -/ - 3 / 1 3

    : • M S li O c • v a tf • (3 1 1 ud A eo Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. rs c n
  56. )82 1 8 0 -/ - 3 / 1 3

    : • M S li O c • v a tf • (3 1 1 ud A eo https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Shiba_Inu.jpg/250px-Shiba_Inu.jpg Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. rs c n
  57. / - 1 - / 4 app.intent('Today Dog - yes',

    conv => { const dogName = conv.data.dogName if (conv.screen) { // %.%+'  } else { const screenAvailable = conv.available.surfaces.capabilities.has('actions.capability.SCREEN_OUTPUT'); if (screenAvailable) { // %. $!*()") const context = '# %&- '; const notification = '# ' + dogName + '%,'; const capabilities = ['actions.capability.SCREEN_OUTPUT']; conv.ask(new NewSurface({ context, notification, capabilities })); } else { // %+'  (  } } }) - Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.
  58. app.intent('Today Dog - yes', conv => { const dogName =

    conv.data.dogName if (conv.screen) { // %.%+'  } else { const screenAvailable = conv.available.surfaces.capabilities.has('actions.capability.SCREEN_OUTPUT'); if (screenAvailable) { // %. $!*()") const context = '# %&- '; const notification = '# ' + dogName + '%,'; const capabilities = ['actions.capability.SCREEN_OUTPUT']; conv.ask(new NewSurface({ context, notification, capabilities })); } else { // %+'  (  } } }) - G M ? ! // - Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. M -2 / 4 2 /
  59. app.intent('Today Dog - yes', conv => { const dogName =

    conv.data.dogName if (conv.screen) { // '0'!-)  } else { const screenAvailable = conv.available.surfaces.capabilities.has('actions.capability.SCREEN_OUTPUT'); if (screenAvailable) { // '0"&#,()$+ const context = ' % '!(/ '; const notification = ' % ' + dogName + ''!.'; const capabilities = ['actions.capability.SCREEN_OUTPUT']; conv.ask(new NewSurface({ context, notification, capabilities })); } else { // '!-)  *  } } }) AoG Client Library NewSurface"&       Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. / - - / 3 4
  60.     • E actions_intent_NEW_SURFACE / / •

    BDI / / app.intent(‘New Surface’, (conv, input, newSurface) => { if (newSurface.status === ‘OK’) { const dogName = conv.data.dogName const dogImageUrl = conv.data.dogImageUrl conv.ask(dogName + '') //   } else { //  } }) Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. - 4 4 / / M
  61.   Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

     
  62.    Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights

    Reserved.  
  63.         Copyright (C)

    2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.
  64. BasicCard Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

  65. app.intent('basic', (conv) => { // h c if (!conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT')) {

    conv.close(' R BasicCard '); return; } conv.ask('BasicCard ’); conv.ask(new BasicCard({ title: ' ', subtitle: ' ', text: '** ** ¥n *Ok Google, *', image: new Image({ url: ' URL', alt: ' ', }), buttons: new Button({ title: 'n ', url: 'https://assistant.google.com/services/a/uid/00000045ffe70d1e?hl=ja', }), display: 'CROPPED', })); // Suggest conv.ask(new Suggestions(suggestions)); }); Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. hi e
  66. app.intent('basic', (conv) => { // s if (!conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT')) { conv.close('

    BasicCard ci '); return; } conv.ask('BasicCard ci ’); conv.ask(new BasicCard({ title: ' ', subtitle: ' ', text: ‘** ** e *', image: new Image({ url: ' URL', alt: ' ', }), buttons: new Button({ title: ' ', url: 'https://assistant.google.com/services/a/uid/00000045ffe70d1e?hl=ja', }), display: 'CROPPED', })); // hSuggest conv.ask(new Suggestions(suggestions)); }); p Simple Response / R n Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. s o
  67. Carousel Media Response Table https://developers.google.com/actions/assistant/responses Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien

    All Rights Reserved.
  68.  Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. 

    
  69. SSML Copyright (C) 2018 Namito.Satoyama. All Rights Reserved.  

     11 3 31 /: / / 1 • TWR L X • . C TWCA • - G • 3 : 11 3 31 • 1C S M Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.   
  70. / <> / .0 " <> / L <speak> 

         break 0.5 S M = Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. 5
  71. - - > - - - - Copyright (C) 2019

    Namito.Satoyama, Shinji.Ichien All Rights Reserved. D
  72. oqpr . G= A A ; / = AG =

    5 T A G 5CC , A 0=5 ;: .CC L D G C A M" A G 5; , g + 5> G= , ' ( e a } aik n ubml 5CC G + C 5> 5; + C 5> " } aik uhx fml A G = C 5 5; , gdc 5CC G L C <) + C 5> 5; + C 5> = C 5 G) = C 5 5; M" Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. {ts yʼ w
  73. - Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

  74.  Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. 

    
  75.  0 = . " = 5 0  

     0 = / = 5 0 < > time strength > Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.
  76. Break Break Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.

     
  77. 23 >0 0> 7 =<= 0> 20=37 08 >0 0>

    23 76 >0 0> 7 =<= 0> =37 08 >0 0> > >0 0> 7 =<= 0> 30 = 0 33 " " "" >0 0> >0 0> 7 =<= 0> 7 = 0 0 3 078 " >0 0> - + >0 0> 7 =<= 0> 260=02 => / - >0 0> 4 >0 0> 7 =<= 0> 8 <6 = 0 " "" " >0 0> 8< 1 S >0 0> 7 =<= 0> 18 < S >0 0> >0 0> E P C Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. a
  78.      Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien

    All Rights Reserved. 
  79. 3 % " 1 3 >=2 C U L 0

    D 3 >2 / 3 >2 1 3 3 % 1 3 >=2 C U L 0 D >< 3 "" 3 >2 / 3 >2 1 3 >< 3 "" 0 3 1% 0 3 1 % 3 2 1 % 3 % " 1 3 >=2 C U L 0 D >< 3 "" 2 < "> 2 < 3 > = < 1 % = < 1 = > 3 >2 / 3 >2 1 3 1 3 U L E Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. T BR
  80.       Copyright (C) 2019 Namito.Satoyama,

    Shinji.Ichien All Rights Reserved. 
  81.  Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. 

    
  82.   / : . / Copyright (C) 2019 Namito.Satoyama,

    Shinji.Ichien All Rights Reserved.  
  83.  Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved. 

    
  84.  • Google"$%&1*K57LI  • Google"$%&1*F)+#% >9 E6 -/')+#%8 <!

    • AudioVisual0%,1%  >9  AMB4G2=? • .('UIHD3;2= :J8   C@ Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.  
  85.  Copyright (C) 2019 Namito.Satoyama, Shinji.Ichien All Rights Reserved.