https://github.com/seadowg/dave
A small framework for building API.AI web fulfillment
https://github.com/seadowg/dave
google-home http kotlin
Last synced: about 1 year ago
JSON representation
A small framework for building API.AI web fulfillment
- Host: GitHub
- URL: https://github.com/seadowg/dave
- Owner: seadowg
- Created: 2017-08-25T13:46:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-25T13:47:00.000Z (over 8 years ago)
- Last Synced: 2025-02-04T00:55:02.568Z (about 1 year ago)
- Topics: google-home, http, kotlin
- Language: Kotlin
- Size: 55.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dave
A small framework for building API.AI web fulfillment.
```kotlin
class MarcoPoloAction : ActionHandler {
override fun handle(request: Request): Response {
return when (request.params["speech"]) {
"marco" -> Response("Polo!", emptyList())
else -> Response("", emptyList())
}
}
}
class FallbackAction : ActionHandler {
override fun handle(request: Request): Response {
return Response("I'm not sure that's part of the game...", emptyList())
}
}
fun main(args: Array) {
val server = Server()
server.serve(8080, mapOf(
"marco_polo" to MarcoPoloAction(),
"input.unknown" to FallbackAction()
))
}
```