Kotlin implementation for voice technologies.
repositories {
jcenter()
}
dependencies {
compile 'au.com.louth:kwiet-actions-sdk:0.4'
}
fun mainHandler(request: AppRequest, context: Context) = simpleResponse {
textToSpeech = "Hello world"
}
fun echoHandler(request: AppRequest) = simpleResponse {
textToSpeech = request.getArg("text")
}
fun quitHandler() = finalResponse {
textToSpeech = "Goodbye"
}
val handlers = mapOf(
StandardIntent.MAIN to ::mainHandler,
StandardIntent.TEXT to ::echoHandler,
StandardIntent.CANCEL to ::quitHandler)
fun handleActionRequest(request: AppRequest) = handleLambdaRequest(handlers, request)
Please note that this project is released with a Contributor Code of Conduct. By contributing to this project (commenting or opening PR/Issues etc) you are agreeing to follow this conduct, so please take the time to read it.
This project began as a fork of https://github.com/Ticketmaster/actions-on-google-kotlin
kwiet is licensed under the Apache 2.0 License. See LICENSE for details.
Copyright (c) 2018, Andrew Louth and Contributors