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
460
コミュニティ運営から 中の人に変わって感じたこと
hideokamoto
0
53
Developerが Developer Advocateになった話 / dev-rel-meetup-tokyo-71
hideokamoto
0
270
Jamstack開発者のための App Runner入門
hideokamoto
1
420
WordPressでの webサイト制作2022 / ngk2022s
hideokamoto
0
380
JavaScript(TypeScript)で メディアサイトを インフラから構築する方法 / jsconf-jp-2021
hideokamoto
2
4k
AWS上でStripeを利用したアプリをより安全にデプロイする方法 /jaws-pankration-2021
hideokamoto
1
170
Shifter Headlessと Headless WordPressの紹介
hideokamoto
0
1.6k
Stripe & Next.js + AWS Amplify で会員 + 定期課金機能 / JP_Stripes20210903
hideokamoto
7
3k
Other Decks in Technology
See All in Technology
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
750
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
990
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
170
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
Lexical Analysis
shigashiyama
1
150
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
580
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Bash Introduction
62gerente
608
210k
Teambox: Starting and Learning
jrom
133
8.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
We Have a Design System, Now What?
morganepeng
50
7.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Rails Girls Zürich Keynote
gr2m
94
13k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
4 Signs Your Business is Dying
shpigford
180
21k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
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