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
Actions Builderによるアクションのビジュアルプログラミング
Search
Daisuke Kobayashi
October 17, 2020
Programming
0
140
Actions Builderによるアクションのビジュアルプログラミング
GDG DevFest 2020 でお話した内容の資料です。
デモンストレーションとセットですので、Youtubeの動画も合わせてご覧下さい。
Daisuke Kobayashi
October 17, 2020
Tweet
Share
More Decks by Daisuke Kobayashi
See All by Daisuke Kobayashi
Google アシスタント アクション運用の知見あれこれ
covayashi
1
730
Transactions API
covayashi
6
2.8k
Other Decks in Programming
See All in Programming
SQL Server ベクトル検索
odashinsuke
0
170
AI Coding Agent Enablement - エージェントを自走させよう
yukukotani
13
5.8k
AHC 044 混合整数計画ソルバー解法
kiri8128
0
330
MCP調べてみました! / Exploring MCP
uhzz
2
2.2k
国漢文混用体からHolloまで
minhee
1
170
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6k
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
200
生成AIを使ったQAアプリケーションの作成 - ハンズオン補足資料
oracle4engineer
PRO
3
200
CRE Meetup!ユーザー信頼性を支えるエンジニアリング実践例の発表資料です
tmnb
0
630
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
320
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
140
Empowering Developers with HTML-Aware ERB Tooling @ RubyKaigi 2025, Matsuyama, Ehime
marcoroth
1
230
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.1k
A Tale of Four Properties
chriscoyier
158
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.6k
Done Done
chrislema
183
16k
Six Lessons from altMBA
skipperchong
27
3.7k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
390
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Rails Girls Zürich Keynote
gr2m
94
13k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Gamification - CAS2011
davidbonilla
81
5.2k
Unsuck your backbone
ammeep
670
57k
Transcript
Actions Builderによる ビジュアルプログラミング
Daisuke Kobayashi Programmer Gurunavi 絵を描いたり ゲーム作ったり webサイト作ったり twitter.com/0rga 0rga.org
None
1.Actions Builder について 2.Actions Builder の解説とデモ 3.Actions SDK について(軽く) お話する事
Actions Builderについて
2020/6/17に Actions Builderが リリースされました
Actions Builderとは 概要 - Actions Builderとは、Actionsコンソールで直接開発、テ スト、およびデプロイができる、WebベースのIDE - グラフィカルインターフェイスを使用しており、会話の流れを 視覚化できる
- 自然言語理解(NLU)トレーニングデータの管理
Devices Dialogflow Google Assistant Actions Before
Devices Actions Builder Google Assistant Actions After
設計方針の大きな違い Dialogflow Actions Builder 会話の流れを 構築していく 会話の場面を作り 繋げていく
新しい概念 Scenes の登場 会話の場面(Scenes)を繋げて、会話を流れを作る Scenes A Scenes B Scenes C
Scenes D
Scenesのライフサイクルとループ処理 Scenes A On enter Conditions Slot filling Prompts Intent
Transition Scenes B
Scenesのライフサイクルとループ処理 Scenes A Conditions Slot filling Prompts Intent Transition Scenes
B - Scenesがアクティブ化されたときに1回だけ実行され るステップ - Webhookをトリガーするか、シーンの1回限りのセッ トアップを行うようにユーザーに促すことができる On enter
Scenesのライフサイクルとループ処理 Scenes A On enter Slot filling Prompts Intent Transition
Scenes B Conditions - 次のステップに進める前に、パラメータが特定の値を 持っているかどうかに基づいて、ロジックを実行でき るステップ - ロジック次第では、別のシーンに移動したり、会話を 終了できたりする
Scenesのライフサイクルとループ処理 Scenes A On enter Prompts Intent Transition Scenes B
Conditions - ユーザーの入力を収集するためのステップ - Slotを埋めようと、Scenesのライフサイクルが動く Slot filling
Scenesのライフサイクルとループ処理 Scenes A On enter Intent Transition Scenes B Conditions
Slot filling - これまでのステップで集めたキューを元に、ユーザに 発話するステップ Prompts
Scenesのライフサイクルとループ処理 Scenes A On enter Slot filling Prompts Transition Conditions
Intent - Scenesのループを終了するための遷移基準を、定義で きるステップ - 遷移しない場合、ループは Conditions に戻る Scenes B
Actions Builder の 解説とデモ
デモで作るもの 仕様 - じゃんけんが出来るアクション - アクション名は「じゃんけんマシーン」 - ユーザが止めるまで、じゃんけんは続く - じゃんけんマシーンがグーチョキパーの何を出すかはランダム
VUI 設計 こんにちは、じゃんけんマ シーンです。 じゃんけんをしますか? じゃーんけーん はい グー 私はチョキ、あなたはグー。 あなたの勝ち!
もう一回じゃんけんしますか? じゃーんけーん… はい OK Google じゃんけん マシーンにつないで : :
Scenes 設計 じゃんけんをす るかどうか尋ね るシーン じゃんけんをす るシーン もう一度、 じゃんけんをす るかどうか尋ね
るシーン 「こんにちは、じゃんけん マシーンです」 会話終了 YES NO
下準備1 プロジェクトの作成
下準備2 アクション名の設定
こんにちは、じゃんけん マシーンです。 これを作る
Main invocation 概要 - ユーザーがアクションとの会話を開始するためのエントリーポ イント - ユーザーからの 「OK Google,
〇〇◦につないで」 と言うような invocation(呼び出し)に反応する部分
Main invocationの設定
こんにちは、じゃんけんマ シーンです。 じゃんけんをしますか? これを作る
Scenesの作成
Scenesの設定
じゃんけんをしますか? はい これを作る
Intents 概要 - アクションが理解できる、ユーザーの入力を定義できる - System intent と Custom intent
がある - Training phrases - ユーザの入力の定義の例の事 - Assistant NLU(自然言語理解)エンジンは、 Training Phrasesを拡張して、 他の類似したフレーズを含めることができる
Custom Intentの作成
ScenesにCustom Intent handlingを設定
はい じゃーんけーん グー これを作る
Custom Intent handlingで別Scenesに
Types 概要 - ざっくり言うと、Intentsの複数版。 - ユーザ入力の同義語を定義し判別できる。
// Custom Intent のイメージ { yes: ['はい', 'OK', 'YES', 'もちろん',
'オッケー', ... ] } // Types のイメージ { meat : { beef: ['牛肉', 'ビーフ', 'ステーキ', ... ], pork: ['豚肉', 'ポーク', 'とんかつ', ... ], chicken: ['鶏肉', 'チキン', 'から揚げ', ... ], } }
Typesの作成
Typesの設定
Slot fillingの設定
Slot fillingの設定
Conditionの設定
グー 私はチョキ、 あなたはグー。 あなたの勝ち! これを作る
Conditionの条件分岐の作成
私はチョキ、 あなたはグー。 あなたの勝ち! もう一回 じゃんけんしますか? これを作る
Conditionから別Scenesに
Conditionから別Scenesに
Scenesの設定
ScenesにCustom Intent handlingを設定
私はチョキ、 あなたはグー。 あなたの勝ち! ラ ン ダ ム に し た
い
Webhook Actions SDK Node.js Fulfillment Library
const { conversation } = require('@assistant/conversation'); const functions = require('firebase-functions');
const app = conversation({debug: true}); const jankenTypeName = { gu: 'グー', tyoki: 'チョキ', pa: 'パー' }; const judgeMap = { gu: { gu: 'あいこ!', tyoki: 'あなたの勝ち!', pa: 'あなたの負け!' }, tyoki: { gu: 'あなたの負け!', tyoki: 'あいこ!', pa: 'あなたの勝ち!' }, pa: { gu: 'あなたの勝ち!', tyoki: 'あなたの負け!', pa: 'あいこ!' } }; 新しいライブラリに
app.handle('janken', conv => { const actionChoice = ['gu', 'pa', 'tyoki'][Math.floor(Math.random()
* 3)]; const message = judgeMap[conv.session.params.chosenJankenType][actionChoice]; conv.add(`私は${jankenTypeName[actionChoice]}、あなたは ${jankenTypeName[conv.session.params.chosenJankenType]}、${message}`); }); exports.ActionsOnGoogleFulfillment = functions.https.onRequest(app); intent から handle に ask から add に
Actions SDK について
Actions SDK ファイルとコマンドラインの利点 - 手元の環境で作業が可能 - ファイルのバージョン管理が可能 - gactions コマンドで
pull / push が可能 - 独自のツールを適用可能
今回作ったデモを pull してきたもの
// Custom Intentでつくった「yes.yaml」 trainingPhrases: - そうだよ - そうです - もちろん
- それで - よろしく - おねがい - "YES" - OK - うん - はい
// Scenesでつくった「start.yaml」 intentEvents: - intent: "yes" transitionToScene: janken - handler:
staticPrompt: candidates: - promptResponse: firstSimple: variants: - speech: では、さようなら intent: "no" transitionToScene: actions.scene.END_CONVERSATION onEnter: staticPrompt: candidates: - promptResponse: firstSimple: variants: - speech: じゃんけんをしますか?
1.Actions Builderのグラフィカルインターフェ イスで、よりノンコーティングに。 2.Actions SDKで、より自由に。 まとめ
Thank you!