项目作者: lischenko

项目描述 :
Amazon Alexa Skill for Interactive Fiction (Z-Machine). Clojure. Implemented without Alexa Skill SDK.
高级语言: Clojure
项目地址: git://github.com/lischenko/interactive-fiction-alexa-skill.git
创建时间: 2016-12-26T20:26:29Z
项目社区:https://github.com/lischenko/interactive-fiction-alexa-skill

开源协议:Eclipse Public License 1.0

下载


Interactive Fiction Alexa Skill

A Z-Machine for Alexa.

See it in action

Playing Galatea on Alexa

Usage

This skill has been deployed to Alexa Skill Store; just say “Alexa, enable Interactive Fiction”. If you don’t have an Alexa device, you can try the skill out on https://echosim.io/ but it does not support sessions, making it seriously harder to use than a real Echo.

The official page of the skill on Amazon.com.

Installation

(Pre-requisites: install Maven and Leiningen)

If you want to build it from scratch:

  • Get, build and install ZAX into local Maven repository:
  1. #!/bin/bash
  2. pushd ~/tmp/
  3. git clone https://github.com/mattkimmel/zax.git
  4. cd zax
  5. git checkout -f 3113c4a74140628cfd0209c4756057f129ae2215 # tested with this version
  6. patch --ignore-whitespace build.gradle << EOF
  7. 32a33,37
  8. >
  9. > java {
  10. > sourceCompatibility = JavaVersion.VERSION_1_8
  11. > targetCompatibility = JavaVersion.VERSION_1_8
  12. > }
  13. \ No newline at end of file
  14. EOF
  15. rm -f zax.jar
  16. ./gradlew clean build
  17. jar cvmf build/tmp/jar/MANIFEST.MF zax.jar -C build/classes/java/main/ com
  18. mvn install:install-file -Dfile=zax.jar -DgroupId=github-mattkimmel -DartifactId=zax -Dversion=0.92-SNAPSHOT-5 -Dpackaging=jar
  19. popd
  • Clone this project and build an uberjar with Leiningen:
    1. git clone https://github.com/lischenko/interactive-fiction-alexa-skill
    2. cd interactive-fiction-alexa-skill/
    3. lein uberjar
    The resulting jar is ready to be uploaded to an AWS Lambda function.
  • Set your Lambda function handler to ifas.ZLambdaFunction::handleLambda
  • Create DynamoDB tables (using aws cli in this example):
    ```bash

    !/bin/bash

aws dynamodb create-table —table-name IfasStoryLinks —attribute-definitions AttributeName=name,AttributeType=S —key-schema AttributeName=name,KeyType=HASH —provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1

aws dynamodb create-table —table-name IfasStoryDumps —attribute-definitions AttributeName=customerId,AttributeType=S AttributeName=url,AttributeType=S —key-schema AttributeName=customerId,KeyType=HASH AttributeName=url,KeyType=RANGE —provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1
```

The IfasStoryLinks table contains mappings from story names to URLs (should be pre-configured), and IfasStoryDumps keeps track of user state and is managed by the skill.

License

Copyright © 2016–2019 Vitaly Lishchenko

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.