Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Alexa Skills kit SDK for Python を使ってみた
Ippei Sumida
September 03, 2018
Programming
0
310
Alexa Skills kit SDK for Python を使ってみた
AAJUG Vol.2でLTしたスライドです。 #aajug
Ippei Sumida
September 03, 2018
Tweet
Share
More Decks by Ippei Sumida
See All by Ippei Sumida
はじめてのCI - 実践編 -
ippey
1
50
はじめてのCI - 概要と準備編 -
ippey
0
150
SymfonyとDoctrineで 簡単クリーンアーキテクチャ
ippey
8
2.2k
小学生中学年向けプログラミング授業
ippey
0
40
functions.phpからプラグインへ
ippey
2
500
ざっくり100%GPL
ippey
0
33
Symfony公式の『日本語』入門書ができたよって話
ippey
1
540
『初心者もOK!男木島に思いを馳せながらブロックエディターを使ってページを作ろう!』フォロー
ippey
0
160
初心者でもOK!男木島に思いを馳せながらブロックエディターを使ってページを作ろう!
ippey
0
81
Other Decks in Programming
See All in Programming
Web API連携でCSRF対策がどう実装されてるか調べた / how to implements csrf-detection on Web API
yasuakiomokawa
2
510
Swift Regex
usamik26
0
210
Opsしかやってこなかった私が DevOpsが根付いたチームにJoinした話
yhamano
1
100
設計の学び方:自分流のススメ
masuda220
PRO
10
7.5k
AWS Config Custom Rule、ノーコードでできるかな?
watany
0
110
こそこそアジャイル導入しようぜ!
ichimichi
0
1.3k
プロダクトのタイプ別 GraphQL クライアントの選び方
shozawa
0
5.8k
チームでカレーを作ろう!アジャイルカレークッキング
akitotsukahara
0
900
Cross Deviceチームにおけるスマートテレビアプリ開発ってどんな感じ?
cokaholic
0
120
Lancersをコンテナへ本番移行する取り組み
rvirus0817
1
420
UI Testing of Jetpack Compose Apps, AppDevCon
alexzhukovich
0
170
Imperative is dead, long live Declarative! | Appdevcon
prof18
0
120
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
47
3.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
236
1M
Fireside Chat
paigeccino
12
1.3k
Stop Working from a Prison Cell
hatefulcrawdad
261
17k
WebSockets: Embracing the real-time Web
robhawkes
57
5.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
316
22k
Designing with Data
zakiwarfel
91
3.9k
Fontdeck: Realign not Redesign
paulrobertlloyd
73
4.1k
How To Stay Up To Date on Web Technology
chriscoyier
780
250k
Fantastic passwords and where to find them - at NoRuKo
philnash
27
1.5k
Documentation Writing (for coders)
carmenhchung
48
2.6k
What’s in a name? Adding method to the madness
productmarketing
11
1.6k
Transcript
Alexa Skills kit SDK for Python ΛͬͯΈͨ 2018.09.03 AAJUG #2
# whoami - ֯ాɹҰฏʢ͢Έͩɹ͍͍ͬʣ - ϑϦʔϥϯε - PHPͱ͔ - CoderDojoຕํͬͯ·͢
- Alexa Skill Contest Լ͔Β͑ͯ2Ґ
※ͬͯΈͨϨϕϧͰ͢ɻ ʢ·ͩεΩϧ࡞ͬͯΔ్தʣ
None
None
͍ͭ࠷ۙެ͔ࣜΒ Python༻ͷSDK͕ൃදʂ
Requirement • Python 2.7, Python 3.6Ҏ্ • VirtualenvʢԾڥߏஙπʔϧʣ • Lambda͕͑Δ
What’s Python ?
Python • ίʔυ͕γϯϓϧ • ίʔυྔ͕গͳ͍ • Մಡੑ͕ߴ͍
ͬͯΈͨ
Πϯετʔϧ virtualenv skill source skill/bin/activate pip install ask-sdk
from ask_sdk_core.skill_builder import SkillBuilder from ask_sdk_core.dispatch_components import AbstractRequestHandler from ask_sdk_model.ui
import SimpleCard from ask_sdk_core.utils import is_intent_name, is_request_type class HelloWorldIntentHandler(AbstractRequestHandler): def can_handle(self, handler_input): return is_request_type("IntentRequest") and is_intent_name("HelloWorldIntent") def handle(self, handler_input): speech_text = "Hello World"; return handler_input.response_builder.speak(speech_text).set_card( SimpleCard("Hello World", speech_text)).response sb = SkillBuilder() sb.request_handlers.extend([ HelloWorldIntentHandler() ]) handler = sb.lambda_handler() Ϋϥεόʔδϣϯ
from ask_sdk_core.skill_builder import SkillBuilder from ask_sdk_core.utils import is_intent_name from ask_sdk_model.ui
import SimpleCard sb = SkillBuilder() @sb.request_handler(can_handle_func=is_intent_name("HelloWorldIntent")) def hello_world_intent_handler(handler_input): speech_text = "Hello World!" return handler_input.response_builder.speak(speech_text).set_card( SimpleCard("Hello World", speech_text)).response handler = sb.lambda_handler() σίϨʔλʔόʔδϣϯ
ʢݸਓతʹʣ ݟ௨͕͠ྑ͍ʂ
ख์͠Ͱتͳ͍
lambdaͷΞοϓϩʔυ ϑΝΠϧ࡞
node.jsͷ߹
cd /path/to/project zip project.zip .
6.5MB
Pythonͷ߹
cd /path/to/project zip project.zip project.py cd venv/lib/python3.6/site-packages zip -r9g /path/to/project/project.zip
.
12.2MB
Node.js > Python खؒతʹ
Node.js < Python ݸਓతʹ