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
AWS Summit Japan 2025 Community Stage - App workflow automation by AWS Step Functions
matsuihidetoshi
1
270
GeminiとNotebookLMによる金融実務の業務革新
abenben
0
230
BigQuery Remote FunctionでLooker Studioをインタラクティブ化
cuebic9bic
3
300
あなたの声を届けよう! 女性エンジニア登壇の意義とアウトプット実践ガイド #wttjp / Call for Your Voice
kondoyuko
4
450
Delegating the chores of authenticating users to Keycloak
ahus1
0
120
Understanding_Thread_Tuning_for_Inference_Servers_of_Deep_Models.pdf
lycorptech_jp
PRO
0
120
“社内”だけで完結していた私が、AWS Community Builder になるまで
nagisa53
1
400
生成AI時代 文字コードを学ぶ意義を見出せるか?
hrsued
1
480
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
220
生成AIでwebアプリケーションを作ってみた
tajimon
2
150
AWS アーキテクチャ作図入門/aws-architecture-diagram-101
ma2shita
29
11k
セキュリティの民主化は何故必要なのか_AWS WAF 運用の 10 の苦悩から学ぶ
yoh
1
170
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.3k
Bash Introduction
62gerente
614
210k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Six Lessons from altMBA
skipperchong
28
3.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
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