Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AlexaSkillのVUIを改善した話

euledge
April 28, 2021

 AlexaSkillのVUIを改善した話

JAWS-UG浜松 AWS勉強会 2021#4で話した資料です。

個人開発のAlexaスキルを改善するために行ったことの紹介

euledge

April 28, 2021
Tweet

More Decks by euledge

Other Decks in Technology

Transcript

  1. Kuroyanagi Hitoshi @euledge https://github.com/euledge 黒 柳 仁 自己紹介 普段は SpringBoot(Java)

    + Vue.js でお仕事してます。 開発チームの体制づくりのためのツール導入とか、フレームワークづくりとか 最近はDDDとかAmplify+LINE APIに興味あり
  2. let persistAttributes = (await attributesManager.getPersistentAttributes()) || {}; persistAttributes.lastAccess = dayjs().toISOString();

    persistAttributes.streetName = streetName; attributesManager.setPersistentAttributes(persistAttributes); await attributesManager.savePersistentAttributes(); Alexa Skill KitでDynamoDBに対して attributesManagerでアクセスできる。
  3. 読み仮名も一緒に渡して読ませる function getPronounceTown(streetName) { const street = area_days.find((item) => item.street

    === streetName); const streetPronunciation = street.streetPronunciation; return `<break time="0.2s" /><say-as interpret-as="address">${streetPronunciation}</say- as><break time="0.1s" />`; } const speechText = `${getPronounceTown(resolutionName)}の次の収集日 は ${collectionDate} です。<break time="0.2s" /> 次のご利用の時にも<break time="0.1s" /> ${getPronounceTown(resolutionName)}<break time="0.1s" />の収集日をお知らせ しますか?`; {"street": "木原", "area": "袋井西", "streetPronunciation": "木原(きわら)", "areaPronunciation": "袋井西", "alias": "", "days": "20210309 20210324 20210408 20210422 }, { "street": "土橋", "area": "袋井西", "streetPronunciation": "土橋(つちはし)", "areaPronunciation" : "袋井西", "alias" : "", "days" : "20210309 20210324 20210408 20210422 }, { "street" : "可睡" , "area" : "袋井北" , "streetPronunciation" : "可睡(かすい)" , "areaPronunciation" : "袋井北", "alias" : "かすい" , "days" : "20210311 20210326 20210413 20210427 }
  4. リマインダーに追加するにはアクセス権の許可が必要 const client = handlerInput.serviceClientFactory.getReminderManagementServiceClient(); const reminderRequest = { trigger:

    { type: "SCHEDULED_ABSOLUTE", // 指定時刻にリマインド scheduledTime: remindAt, }, alertInfo: { spokenInfo: { content: [ { locale: "ja-JP", text: `明日は${streetName}の不燃物収集日です。`, }, ], }, }, pushNotification: { status: "ENABLED", }, }; console.log(JSON.stringify(reminderRequest)); const reminderResponse = await client.createReminder(reminderRequest); console.log(JSON.stringify(reminderResponse));
  5. Alexa Skill開発の情報ソース • Alexa道場 Alexa Skills Kit: Webinars (amazon.com) •

    Alexa Skills Kit (ASK) (日本語) - Forums (amazon.com) • Slack alexa-jp