# ask-alexa-pykit
Release Version : <b>Master</b> (Unstable! For a stable release, check out the 0.5 branch)
ask-alexa-pykit 0.5 is out!
A minimalist framework for developing apps (skills) for the Amazon Echo's SDK: The Alexa Skills Kit (<b>ASK</b>).
Projects that use this library
--------------
- Rap Battle Alexa - http://devpost.com/software/rapbattlealexa
- Twitter Reader (Official Twitter Skill for Alexa)
- How much is it worth - https://www.hackster.io/minus-et-cortex/how-much-it-worth-07e190
- Useful Science - https://github.com/anjishnu/ask-useful-science
- University of Pennsylvania, Deep Learning Methods for Automated Discourse - (http://dialog-systems-class.org/assignment1.html)
- Phillipe Loher's Tutorial: https://mldavidson.phillipe.com/wp-content/uploads/2016/11/ml-alexa.pptx
Other Github Projects
- https://github.com/kfowlks/aws_alexa_comcast_data_usage_lambda
- https://github.com/btelle/poolmon
- https://github.com/mijdavis2/ask-shrugs
- https://github.com/geoaxis/ask-sweden
- https://github.com/cameron-gagnon/CookmATE
- https://github.com/ysak-y/alexa-sqs-home-manager
- https://github.com/ysak-y/alexa-irkit
- https://github.com/mastash3ff/Alexa-IsStreamable
- https://github.com/peterpanning/AlexaTransit
- https://github.com/ysak-y/yeelight-with-alexa
- https://github.com/SydneyDockerMeetupAWS/meetup-code
- https://github.com/kdietze3/alexa-binary-clock
- https://github.com/hassanshamim/thebaker
- https://github.com/btelle/alexa-boardgame-answers
- https://github.com/amphy/alexa-league
- https://github.com/potykion/empatika-internship
- https://github.com/mirkoprescha/alexa-my-reminders
- https://github.com/kdietze3/alexa-transaction-or-no-transaction
- https://github.com/pombredanne/autopy-1
- https://github.com/ktseytlin/AlexaComplimentMe
- https://github.com/j-c-h-e-n-g/alexa-ramdass
- https://github.com/bugbiteme/EMC-NorCal-SE-AlexaChallenge-2016
- https://github.com/daphnei/nn_chatbot
- https://github.com/ysak-y/alexa-doc
- https://github.com/ckeitt/alexa-genius
- https://github.com/amandarice/AnimalTranslator
- https://github.com/armandofox/alexa-marantz-py
- https://github.com/vlnk/alexa-meets-dmn
- https://github.com/amandarice/CodeComments
If this library helps you build some dialog systems or do some interesting research - please remember to cite it!
```
@Misc{kumarask2015,
author = {Anjishnu Kumar},
title = {ASK Alexa PyKit},
howpublished = {\url{github.com/anjishnu/ask-alexa-pykit}},
year = {2015}
}
```
Let me know if you know any other projects that use or build on top of ask-alexa-pykit.
<b>What does this library do?</b>
----------------
- Remove boiler plate from Alexa Skills Kit Code - maps intents directly to their handler functions.
- Provide utils to quickly and effectively generate and manipulate sample utterances and the intent schema.
- Provides python objects to quickly build alexa responses.
- Automatic session management using session variables - your code gets access to a really simple interface for session management, you just add key value pairs to, or delete things from, a python dictionary, and this library along with the ASK platform takes care of the rest.
To use this code for your own skill, simply generate training data, and an intent schema definition and edit <b>lambda_function.py</b> to add handler functions for the intents and requests that your skill supports - this should be enough to get started.
<b>Note</b>: Unless someone asks me to reconsider - I am now only going to do further releases of this library for AWS Lambda - the core library is concise enough that it can be included into any python server framework with just a few imports. The old releases (for cherrypy) will contain the infuriating request validation parts of the library which can be useful for people who don't want to use the Lambda or LambdaProxy approach to skill development.
# What's new?
Latest changes:
- There's a <b>pypi repo</b> now https://pypi.python.org/pypi/ask-alexa-pykit/ - so you should be able to do `pip install ask-alexa-pykit` to use 'ask' as a standard python library or `pip install ask-alexa-pykit --target new_skill_folder` to install it into a directory (which will be your AWS Lambda Function directory).
- Added an actual intent_schema.py module - thin wrapper around the JSON object which allows for easy manipulation, creation and serialization/deserialization. This module also doubles as the generate intent schema script now, with hooks to interactively generate the object.
- The scripts folder is gone now - and the scripts themselves have been moved into the main alexa.ask module, which means that they can stay in sync with the Intent Schema and other config parameters without much fuss.
- The annotation API has changed (become simpler) and the intent map computation and routing now happens under the hood. As of version 0.4 the VoiceHandler object now maintains an internal mapping of handler functions and now takes on the responsibility of handing off incoming requests to the right function end point.
- Now there's only one module that a user has to be aware of. We've fully factored out the alexa specific bits into the <b>ask</b> library and you don't need to see how the mappings are computed.
- The Request class got a minor upgrade - the addition of a 'metadata' field, which allows the developer to easily extend code to inject session, user or device specific metadata (after, for instance, querying a database) into a request object before it gets passed to the annotated handler functions.
- The interface to the ask library function is now uniformly exposed to developers. A voice handler is now a subclass of a ResponseBuilder so that as a user all your really need to do is `from ask import alexa`
- Improved session handling - no need to pass back the session attributes - just edit them in the dict and they'll automatically get propogated.
- Python 2/3 dual compatibility
Basic overview of Classes:
- The Request object contains information about the Alexa request - such as intent, slots, userId etc.
- A VoiceHandler is an object that internally stores a mapping from intents and requests to their corresponding handler functions. These mappings are specified by a simple annotation scheme (see <b>lambda_function.py</b> for an example)
- An alexa (VoiceHandler) annotated class (specified with an annotation) takes a request as an input, performs some arbitrary logic on top of it, and returns a Response.
- The ResponseBuilder is an encapsulated way to construct responses for a VoiceHandler. A Response can be constructed by called ResponseBuilder.create_response.
Step 1: Download Code
-----------
Method 1:
<b>$ git clone https://github.com/anjishnu/ask-alexa-pykit.git </b>
Make sure you're in a python lambda release branch. E.g
<b>
$ cd ask-alexa-pykit
<br>
$ git checkout python_lambda_0.5_release </b>
<br>
Otherwise your build my be broken since the master branch is not always stable.
<br>
Method 2:
<br>
<b>
$ mkdir my_new_skill
<br>
$ pip install ask-alexa-pykit --target my_new_skill
<br>
</b>
ask-alexa-pykit is now installed in your <b>my_new_skill</b> directory. Just import the library and start hacking.
Step 2: Create a intent schema for your app
----------
Skip this if you're trying the included basic example and use <b>sample_intent_schema.json</b> as your <b>INTENT_SCHEMA</b>.
<br><b>
$ python -m ask.intent_schema -i FILEPATH
</b>
This script takes you through the process of generating an intent schema for your app- which defines how Alexa's language understanding system interprets results.
After the process is complete, it asks you whether you the intent schema stored at the appropriate location.
Step 3: Generate training data and upload to Amazon.
--------------
3(a):
Create a file containing your training examples and upload to Amazon.
I've created a script which loads in the intent schema and does some validation and prompting
没有合适的资源?快使用搜索试试~ 我知道了~
一个极简主义的SDK,用于使用AmazonWebServices的Pytho.zip
共40个文件
py:22个
json:4个
txt:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 82 浏览量
2023-04-05
13:00:21
上传
评论
收藏 40KB ZIP 举报
温馨提示
一个极简主义的SDK,用于使用AmazonWebServices的Pytho.zip
资源推荐
资源详情
资源评论
收起资源包目录
一个极简主义的SDK,用于使用AmazonWebServices的Pytho.zip (40个子文件)
ask-alexa-pykit-master
__init__.py 0B
setup.py 529B
LICENSE 1KB
tests
__init__.py 0B
README 55B
test_response_builder.py 2KB
test_request.py 3KB
fixtures
__init__.py 23B
requests.py 4KB
context.py 76B
test_alexa.py 2KB
test-data
sample_request.json 497B
examples
README 85B
basic
speech_assets
sample_intent_schema.json 338B
utterances.txt 0B
lambda_function.py 3KB
twitter
speech_assets
utterances.txt 6KB
intent_schema.json 3KB
custom_slots
TWITTER_MESSAGE.list 2KB
ORDINAL.list 168B
lambda_function.py 14KB
twitter.py 15KB
config.py 61B
useful_science
useful_science.py 2KB
speech_assets
utterances.txt 439B
intent_schema.json 411B
custom_slots
Categories.list 99B
lambda_function.py 2KB
lambda_function.py 4KB
ask
__init__.py 234B
alexa_io.py 7KB
intent_schema.py 4KB
write_sample.py 3KB
data
README 47B
amazon_builtin_slots.tsv 617B
config
__init__.py 0B
config.py 2KB
.gitignore 59B
setup.cfg 27B
README.md 11KB
共 40 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功