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
Alexa Skill開発を加速する ask-utils / vuilt-kyoto-5
Search
Hidetaka Okamoto
September 14, 2018
Technology
0
170
Alexa Skill開発を加速する ask-utils / vuilt-kyoto-5
vuilt kyoto vol.5のスライドです。
Hidetaka Okamoto
September 14, 2018
Tweet
Share
More Decks by Hidetaka Okamoto
See All by Hidetaka Okamoto
OpenAI APIで API Changelogを要約してみた話 / chatgpt-osaka-1
hideokamoto
0
610
コミュニティ運営から 中の人に変わって感じたこと
hideokamoto
0
89
Developerが Developer Advocateになった話 / dev-rel-meetup-tokyo-71
hideokamoto
0
340
Jamstack開発者のための App Runner入門
hideokamoto
1
490
WordPressでの webサイト制作2022 / ngk2022s
hideokamoto
0
450
JavaScript(TypeScript)で メディアサイトを インフラから構築する方法 / jsconf-jp-2021
hideokamoto
2
4.2k
AWS上でStripeを利用したアプリをより安全にデプロイする方法 /jaws-pankration-2021
hideokamoto
1
200
Shifter Headlessと Headless WordPressの紹介
hideokamoto
0
1.9k
Stripe & Next.js + AWS Amplify で会員 + 定期課金機能 / JP_Stripes20210903
hideokamoto
7
3.2k
Other Decks in Technology
See All in Technology
AI時代の開発を加速する組織づくり - ブログでは書けなかったリアル
hiro8ma
1
180
Findy Team+ QAチーム これからのチャレンジ!
findy_eventslides
0
490
クラウドとリアルの融合により、製造業はどう変わるのか?〜クラスメソッドの製造業への取組と共に〜
hamadakoji
0
250
エンタメとAIのための3Dパラレルワールド構築(GPU UNITE 2025 特別講演)
pfn
PRO
0
610
「改善」ってこれでいいんだっけ?
ukigmo_hiro
0
390
[OCI Skill Mapping] AWSユーザーのためのOCI – IaaS編(Compute/Storage/Networking) (2025年10月8日開催)
oracle4engineer
PRO
1
140
[2025年10月版] Databricks Data + AI Boot Camp
databricksjapan
1
230
AIエージェント入門 〜基礎からMCP・A2Aまで〜
shukob
0
130
CoRL 2025 Survey
harukiabe
1
240
コンパウンド組織のCRE #cre_meetup
layerx
PRO
0
130
Claude Code Subagents 再入門 ~cc-sddの実装で学んだこと~
gotalab555
10
17k
それでも私が品質保証プロセスを作り続ける理由 #テストラジオ / Why I still continue to create QA process
pineapplecandy
0
150
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Facilitating Awesome Meetings
lara
56
6.6k
Embracing the Ebb and Flow
colly
88
4.9k
A Tale of Four Properties
chriscoyier
161
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.5k
Building Applications with DynamoDB
mza
96
6.7k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Rails Girls Zürich Keynote
gr2m
95
14k
Transcript
Alexa Skill։ൃΛՃ͢Δ ask-utils VUI LT Vol.5@Kyoto Ԭຊलߴ #VUILT
ࣗݾհ • Digitalcube Co. Ltd. • WordCamp Kyoto 2017࣮ߦҕ һ
• AWS Samurai 2017 H i d e t a k a O k a m o t o #VUILT
Amazon Alexa Japan User Group (AAJUG) https://aajug.connpass.com/ #VUILT
Alexa Day 2018 https://alexaday2018.jaws-ug.jp/ #VUILT
Alexa Champions https://developer.amazon.com/ja/alexa/champions/hidetaka-okamoto #VUILT
ઌʹએ ࣌ؒΦʔόʔͷؾΛײͨ͡ͷͰ #VUILT
11/3 JAWS FESTA 2018 OSAKA https://jft2018.jaws-ug.jp/ #VUILT
·͔͞ͷձ http://suitacityfootballstadium.jp/ #VUILT
ࠓհ͍ͨ͠ͷ https://www.npmjs.com/package/ask-utils #VUILT
ͳΜͰͭͬͨ͘ͷʁ #VUILT
ask-sdkͰͷΠϯςϯτϋϯυϥʔͷॻ͖ํ const HelpIntentHandler = { canHandle (handlerInput) { return handlerInput.requestEnvelope.request.type
=== 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent' }, handle (handlerInput) { const speechText = 'This is example skill' return handlerInput.responseBuilder .speak(speechText) .reprompt(speechText) .withSimpleCard(SKILL_NAME, speechText) .getResponse() } } #VUILT
͜͜Λຖճॻ͘ͷ͕Θ͔ͬͨ͠ const HelpIntentHandler = { canHandle (handlerInput) { return handlerInput.requestEnvelope.request.type
=== 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent' }, handle (handlerInput) { const speechText = 'This is example skill' return handlerInput.responseBuilder .speak(speechText) .reprompt(speechText) .withSimpleCard(SKILL_NAME, speechText) .getResponse() } } #VUILT
npm i -S ask-utils #VUILT
handlerInputͷதΛΑ͠ͳʹνΣοΫͯ͘͠ΕΔ const { canHandle } = require('ask-utils') const HelpIntentHandler =
{ canHandle (handlerInput) { return canHandle(handlerInput, 'IntentRequest', 'AMAZON.HelpIntent') }, handle (handlerInput) { const speechText = 'This is example skill' return handlerInput.responseBuilder .speak(speechText) .reprompt(speechText) .withSimpleCard(SKILL_NAME, speechText) .getResponse() } } #VUILT
ask-utilsͰมΘͬͨ͜ͱ • ୯७ʹίʔυΛॻ͘ྔ͕ݮͬͨ • VS Codeʹೖྗิ͋Δ͚Ͳɺͬͱָ͍ͨ͠ • ʮΑ͘ॻ͘ίʔυʯͷύοέʔδԽͰޮԽ • ask-sdkͷίʔυΛࢀߟʹ͢ΔͷͰɺษڧʹͳΔ
#VUILT
ask-utilsͰΑΓΑ͍VUXΛ #VUILT
Alexa blogʮฦࣄϥϯμϜʹͨ͠ํ͕ࣗવͬΆ͍Αʯ https://developer.amazon.com/ja/blogs/alexa/post/37e732b7-48fa-4940-9f12-9ffde7eeeaf8/alexa- skill-recipe-randomize-your-responses-to-add-variety-to-your-skill
getRandomMessage()ͰҰൃ const { getRandomMessage } = require('ask-utils') const errorMessages =
[ 'I can not here what you say, please say again.', 'Please say again.', "I'm sorry, please tell me again" ] const message = getRandomMessage(errorMessages) #VUILT
ϦΫΤετʹ͕͔͔࣌ؒΔ࣌ɺػίϯςϯπΛ https://developer.amazon.com/ja/docs/custom-skills/send-the-user-a-progressive-response.html
enqueueProgressiveResponseDirective()ͰҰൃ try { // ϓϩάϨογϒϨεϙϯεΛར༻͢Δ await enqueueProgressiveResponseDirective(handlerInput, ‘ݕࡧத') } catch
(err) { // τϥϒϧ͕ൃੜͯ͠ɺॲཧΛܧଓͤ͞Δɻ console.log(err) } // ֎෦ͷ API ͱଓ͢Δ const content = await get() return responseBuilder.speak(content).getResponse() #VUILT
aws-sdk & ask-utilsͰσʔλΛอଘ͢Δ const AWS = require('aws-sdk') const { getUserId
} = require('ask-utils') const dynamoDB = new AWS.DynamoDB.DocumentClient() const TableName = 'MyExampleDB' const SaveProfileHandler = { … async handle(handlerInput) { const userId = getUserId(handlerInput) const params = { TableName, Item: { id: userId, } } await dynamoDB.put(params).promise() ... } } #VUILT
aws-sdk & ask-utilsͰσʔλΛอଘ͢Δ const AWS = require('aws-sdk') const { getUserId
} = require('ask-utils') const dynamoDB = new AWS.DynamoDB.DocumentClient() const TableName = 'MyExampleDB' const SaveProfileHandler = { … async handle(handlerInput) { const userId = getUserId(handlerInput) const params = { TableName, Item: { id: userId, } } await dynamoDB.put(params).promise() ... } } #VUILT
aws-sdk & ask-utilsͰσʔλΛอଘ͢Δ const AWS = require('aws-sdk') const { getUserId
} = require('ask-utils') const dynamoDB = new AWS.DynamoDB.DocumentClient() const TableName = 'MyExampleDB' const SaveProfileHandler = { … async handle(handlerInput) { const userId = getUserId(handlerInput) const params = { TableName, Item: { id: userId, } } await dynamoDB.put(params).promise() ... } } #VUILT
ask-utilsͰͰ͖Δ͜ͱ • UserIDDeviceIDɺIntentNameͷऔಘ • ϓϩάϨογϒϨεϙϯεͷ࡞ • Displayαϙʔτঢ়گͷ֬ೝ • ςετ༻ͷMock Event࡞
• ͦͷ΄͔Զ͕ཉ͘͠ͳͬͨϔϧύʔؔ #VUILT
GitHubͰίʔυެ։ࡁΈ https://github.com/hideokamoto/ask-utils #VUILT
APIυΩϡϝϯτʢ֦ॆதʣ https://ask-utils.github.io/ask-utils/ #VUILT
Example࡞ͬͯΈͨ https://github.com/ask-utils/example #VUILT
ϨϏϡʔ ϓϧϦΫ ཁ ͬͨใࠂϒϩά ࠩ͠ೖΕ ͓·͍ͪͯ͠·͢ʂ #VUILT #VUILT
એ #VUILT
2018/10/08 (݄) 11:00ʙ17:00: ٕज़ॻయ̑ https://techbookfest.org/event/tbf05 #VUILT
AlexaεΩϧ։ൃͷ͍ΖΜͳTips·ͱΊͯ·͢ #VUILT
͓02 ʮΦϨ͕ͨͪΓ͔ͨͬͨΞϨΫαͷʯ https://techbookfest.org/event/tbf05/circle/27560001 #VUILT
9/18 Amazon Alexa Online Discussion #05 https://aajug.connpass.com/event/100409/ #VUILT
11/3 JAWS FESTA 2018 OSAKA εϐʔΧʔืूத https://jawsugosaka.doorkeeper.jp/events/79928 #VUILT
#VUILT