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 Skills kit SDK for Python を使ってみた
Search
Ippei Sumida
September 03, 2018
Programming
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Alexa Skills kit SDK for Python を使ってみた
AAJUG Vol.2でLTしたスライドです。 #aajug
Ippei Sumida
September 03, 2018
More Decks by Ippei Sumida
See All by Ippei Sumida
DROBEの生成AI活用事例 with AWS
ippey
0
320
みんなでQAしてる話
ippey
0
180
AIで生成したものをAIでチェックしてる話
ippey
0
2.3k
『WordPressコミュニティで学ぶ』OSS貢献の多様性
ippey
0
1.3k
25分で理解する!Symfonyの魅力とその実践的活用法
ippey
1
7.8k
素早いバリュー提供のための DROBEの新戦略
ippey
0
1.4k
Symfony 6.3のおすすめ新機能まとめ
ippey
1
2.2k
PhpStorm + GitHub Copilotはいいぞ
ippey
0
3.2k
それぞれの特徴から考えるフレームワーク選び
ippey
1
1.2k
Other Decks in Programming
See All in Programming
C# and C++ Interoperability - cho-dotnetnew
harukasao
0
130
The NotImplementedError Problem in Ruby
koic
1
810
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
260
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
390
AI時代のUIはどこへ行く?その2!
yusukebe
21
7.2k
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.6k
Claspは野良GASの夢をみるか
takter00
0
200
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
200
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.4k
Featured
See All Featured
Abbi's Birthday
coloredviolet
2
8.1k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
390
Ethics towards AI in product and experience design
skipperchong
2
310
Deep Space Network (abreviated)
tonyrice
0
210
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Typedesign – Prime Four
hannesfritz
42
3.1k
The Curious Case for Waylosing
cassininazir
1
390
Building AI with AI
inesmontani
PRO
1
1.1k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Writing Fast Ruby
sferik
630
63k
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 ݸਓతʹ