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
570
コミュニティ運営から 中の人に変わって感じたこと
hideokamoto
0
79
Developerが Developer Advocateになった話 / dev-rel-meetup-tokyo-71
hideokamoto
0
330
Jamstack開発者のための App Runner入門
hideokamoto
1
480
WordPressでの webサイト制作2022 / ngk2022s
hideokamoto
0
430
JavaScript(TypeScript)で メディアサイトを インフラから構築する方法 / jsconf-jp-2021
hideokamoto
2
4.2k
AWS上でStripeを利用したアプリをより安全にデプロイする方法 /jaws-pankration-2021
hideokamoto
1
190
Shifter Headlessと Headless WordPressの紹介
hideokamoto
0
1.8k
Stripe & Next.js + AWS Amplify で会員 + 定期課金機能 / JP_Stripes20210903
hideokamoto
7
3.2k
Other Decks in Technology
See All in Technology
Tech-Verse 2025 Keynote
lycorptech_jp
PRO
0
110
フィンテック養成勉強会#54
finengine
0
180
【TiDB GAME DAY 2025】Shadowverse: Worlds Beyond にみる TiDB 活用術
cygames
0
1.1k
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
220
Wasm元年
askua
0
140
SalesforceArchitectGroupOsaka#20_CNX'25_Report
atomica7sei
0
170
Snowflake Summit 2025全体振り返り / Snowflake Summit 2025 Overall Review
mtpooh
2
400
あなたの声を届けよう! 女性エンジニア登壇の意義とアウトプット実践ガイド #wttjp / Call for Your Voice
kondoyuko
4
450
Prox Industries株式会社 会社紹介資料
proxindustries
0
290
Node-RED × MCP 勉強会 vol.1
1ftseabass
PRO
0
140
Абьюзим random_bytes(). Фёдор Кулаков, разработчик Lamoda Tech
lamodatech
0
340
GitHub Copilot の概要
tomokusaba
1
130
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Why Our Code Smells
bkeepers
PRO
337
57k
Building Adaptive Systems
keathley
43
2.6k
A Tale of Four Properties
chriscoyier
160
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
We Have a Design System, Now What?
morganepeng
53
7.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Raft: Consensus for Rubyists
vanstee
140
7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Faster Mobile Websites
deanohume
307
31k
Fireside Chat
paigeccino
37
3.5k
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