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
740
Transactions API
covayashi
6
2.9k
Other Decks in Programming
See All in Programming
Practical Domain-Driven Design - Workshop at NDC 2025
mufrid
0
130
事業戦略を理解してソフトウェアを設計する
masuda220
PRO
7
1.3k
バランスを見極めよう!実装の意味を明示するための型定義 TSKaigi 2025 Day2 (5/24)
whatasoda
2
780
MLOps Japan 勉強会 #52 - 特徴量を言語を越えて一貫して管理する, 『特徴量ドリブン』な MLOps の実現への試み
taniiicom
2
570
イベントソーシングとAIの親和性ー物語とLLMに理解できるデータ
tomohisa
1
160
TypeScript Language Service Plugin で CSS Modules の開発体験を改善する
mizdra
PRO
3
2.4k
ユーザーにサブドメインの ECサイトを提供したい (あるいは) 2026年函館で一番熱くなるかもしれない言語の話
uvb_76
0
180
JSAI2025 RecSysChallenge2024 優勝報告
unonao
1
380
External SecretsのさくらProvider初期実装を担当しています
logica0419
0
240
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfold' relates to 'iterate'"
philipschwarz
PRO
0
140
〜可視化からアクセス制御まで〜 BigQuery×Looker Studioで コスト管理とデータソース認証制御する方法
cuebic9bic
2
270
漸進。
ssssota
0
1.2k
Featured
See All Featured
Practical Orchestrator
shlominoach
188
11k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
1
82
Building Applications with DynamoDB
mza
95
6.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
Automating Front-end Workflow
addyosmani
1370
200k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Done Done
chrislema
184
16k
How GitHub (no longer) Works
holman
314
140k
For a Future-Friendly Web
brad_frost
178
9.7k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Making Projects Easy
brettharned
116
6.2k
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!