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
460
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
330
みんなでQAしてる話
ippey
0
190
AIで生成したものをAIでチェックしてる話
ippey
0
2.4k
『WordPressコミュニティで学ぶ』OSS貢献の多様性
ippey
0
1.4k
25分で理解する!Symfonyの魅力とその実践的活用法
ippey
1
7.9k
素早いバリュー提供のための DROBEの新戦略
ippey
0
1.5k
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
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
140
初めての模倣学習とVLA
natsutan
0
200
Building a Meta Ray-Ban display app
akkeylab
0
180
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
400
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
500
仕様駆動開発の消費期限
watany
20
8.9k
Oxlintはいいぞ(続)
yug1224
1
400
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
510
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
1
260
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
Hono + Inertia + React で LP を構築した話
oukayuka
2
150
Press start. Python's next generation.
willingc
PRO
2
110
Featured
See All Featured
Designing for Performance
lara
611
70k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
480
Balancing Empowerment & Direction
lara
6
1.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
210
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
620
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
220
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Typedesign – Prime Four
hannesfritz
42
3.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
A Tale of Four Properties
chriscoyier
163
24k
Done Done
chrislema
186
16k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
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 ݸਓతʹ