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
720
Transactions API
covayashi
6
2.8k
Other Decks in Programming
See All in Programming
CI改善もDatadogとともに
taumu
0
110
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
170
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
Immutable ActiveRecord
megane42
0
130
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
550
DROBEの生成AI活用事例 with AWS
ippey
0
130
Kanzawa.rbのLT大会を支える技術の裏側を変更する Ruby on Rails + Litestream 編
muryoimpl
0
220
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.1k
WebDriver BiDiとは何なのか
yotahada3
1
140
Domain-Driven Transformation
hschwentner
2
1.9k
SpringBoot3.4の構造化ログ #kanjava
irof
2
970
Amazon S3 TablesとAmazon S3 Metadataを触ってみた / 20250201-jawsug-tochigi-s3tables-s3metadata
kasacchiful
0
100
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
90
5.8k
Music & Morning Musume
bryan
46
6.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Speed Design
sergeychernyshev
25
780
GraphQLとの向き合い方2022年版
quramy
44
13k
Statistics for Hackers
jakevdp
797
220k
Writing Fast Ruby
sferik
628
61k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
20
2.4k
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!