actions-on-google-kotlin alternatives and similar libraries
Based on the "Misc" category.
Alternatively, view actions-on-google-kotlin alternatives based on common mentions on social networks and blogs.
-
jclasslib
jclasslib bytecode viewer is a tool that visualizes all aspects of compiled Java class files and the contained bytecode. -
kotlin-logging
Lightweight logging framework for Kotlin. Used as a wrapper for slf4j with Kotlin extensions. -
kotlinx-datetime
A multiplatform Kotlin library for working with date and time. -
klock
Consistent and portable date and time utilities for multiplatform kotlin (JVM, JS and Common). -
kotlinx.atomicfu
The idiomatic way to use atomic operations in Kotlin. -
kotlin-telegram-bot
A wrapper for the Telegram Bot API written in Kotlin. -
Kotlift
Kotlift is the first source-to-source language transpiler from Kotlin to Swift. -
lingua
A language detection library suitable for long and short text alike -
better-parse
A nice parser combinator library for Kotlin -
kotlinx.reflect.lite
Lightweight library allowing to introspect basic stuff about Kotlin symbols. -
Humanizer.jvm
Humanizer.jvm meets all your jvm needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities. -
klutter
A mix of random small libraries for Kotlin, the smallest reside here until big enough for their own repository. -
solr-undertow
Solr Standalone Tiny and High performant server. -
kravis
A Kotlin grammar for scientific data visualization -
kotlin-hashids
Library that generates short, unique, non-sequential hashes from numbers. -
SimpleDNN
SimpleDNN is a machine learning lightweight open-source library part of KotlinNLP and has been designed to support relevant neural network architectures in natural language processing tasks. -
kassava
This library provides some useful kotlin extension functions for implementing toString() and equals() without all of the boilerplate. -
koda-time
Joda Time Extensions in Kotlin. (From Java 8 use java.time instead) -
kotlin-futures
A collections of extension functions to make the JVM Future, CompletableFuture, ListenableFuture API more functional and Kotlin like. -
units-of-measure
A type-safe dimensional analysis library for Kotlin. -
KDispatcher
Simple and light-weight event dispatcher for Kotlin -
scientist
A kotlin library for refactoring code. Port of GitHub's scientist. -
sekret
Kotlin compiler plugin to exclude secret properties from toString() of Data class -
kasechange
Multiplatform Kotlin library to convert strings between various case formats including Camel Case, Snake Case, Pascal Case and Kebab Case -
PrimeCalendar
Provides all of the java.util.Calendar functionalities for Civil, Persian, Hijri, Japanese, etc, as well as their conversion to each other. -
kotlin-pluralizer
Kotlin extension to pluralize and singularize strings. -
kotlin-times
A simple utility library for readable loops. -
aleksa
Aleksa is a small framework for writing Alexa Skills in Kotlin. -
kformula
Mathematical expression engine written in Kotlin, running on JVM. -
CakeParse
Simple parser combinator library for Kotlin. -
kase-format
String case conversion and detection library
Get performance insights in less than 4 minutes
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of actions-on-google-kotlin or a related project?
README
Actions On Google Client Library
This is a port of the official Node.js SDK to Kotlin. This can also be used from Java and any JVM language.
Quick Facts
- Port of the actions-on-google SDK to Kotlin. Kotlin and Java developers can quickly start building Actions for Google Assistant.
- Used in production for the Ticketmaster Assistant Action ("Ok Google, ask Ticketmaster to find rock concerts near me.")
- Closely matches Node.js Client Library API
- Closely matches implementation of Node.js sdk so code can be maintained easily as features are added
- All tests ported from nodejs SDK (using Spek framework) & 100% passing
- Dialogflow and Actions SDK support
- Conversation Components & Transaction Sample ported
- Supports v2 of Actions on Google API (if v1 is needed, make an issue please)
V2 Support
The V2 release is available by using:
compile 'com.tmsdurham.actions:actions-on-google:2.0.2'
The V2 is mostly complete, but may have a few bugs and missing features. All Conversation components and Transaction API are working. Dialogflow & ActionSDK has been tested and working. The API matches the official node.js API very closely. The sample in this repo is a good place to get started. The setup and samples in this readme have not been updated yet. There are a few differerences and additions:
* use action name from Dialogflow instead of intent name. The official library changed from using the action field, to using the intent name. There is a PR open on the official SDK for support for action. If/when this is merged, this library will be updated to match.
* middleware not supported. Same functionality can be implemented without lib support by wrapping handlers in fuctions.
V2 notes: A common module was used with the intent on targeting multiple platforms (JS & possibly native). These other platforms are purely experimental at this time. A single code base for JVM and JS would be more efficient.
Setup Instructions(V1 - see sample for V2 setup and use)
This library is available on jCenter. If your using gradle simply add the dependency as follows:
Gradle:
repositories {
jCenter()
}
}
dependencies {
compile 'com.tmsdurham.actions:actions-on-google:1.6.0'
}
Maven:
<dependency>
<groupId>com.tmsdurham.actions</groupId>
<artifactId>actions-on-google</artifactId>
<version>1.6.0</version>
<type>pom</type>
</dependency>
The above artifact should fit the needs of most developers, however, if you are not using java.servlet.http.HttpServlet
, or do not want to use Gson for deserialization, you can use the actions-on-google-core lib
. For example how to use the core library, reading through the sdk-gson-servlet module.
Gradle:
compile 'com.tmsdurham.actions:actions-on-google-core:1.6.0'. //only if not using Servlets
Maven:
<dependency>
<groupId>com.tmsdurham.actions</groupId>
<artifactId>actions-on-google-core</artifactId> //only if not using Servlets
<version>1.6.0</version>
<type>pom</type>
</dependency>
Using Kotlin
fun welcome(app: DialogflowApp) =
app.ask(app.buildRichResponse()
.addSimpleResponse(speech = "Hi there!", displayText = "Hello there!")
.addSimpleResponse(
speech = """I can show you basic cards, lists and carousels as well as
"suggestions on your phone""",
displayText = """"I can show you basic cards, lists and carousels as
"well as suggestions"""")
.addSuggestions("Basic Card", "List", "Carousel", "Suggestions"))
fun normalAsk(app: DialogflowApp) = app.ask("Ask me to show you a list, carousel, or basic card")
fun suggestions(app: DialogflowApp) {
app.ask(app
.buildRichResponse()
.addSimpleResponse("This is a simple response for suggestions")
.addSuggestions("Suggestion Chips")
.addSuggestions("Basic Card", "List", "Carousel")
.addSuggestionLink("Suggestion Link", "https://assistant.google.com/"))
}
val actionMap = mapOf(
WELCOME to ::welcome,
NORMAL_ASK to ::normalAsk,
SUGGESTIONS to ::suggestions)
@WebServlet("/conversation")
class WebHook : HttpServlet() {
override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
DialogflowAction(req, resp).handleRequest(actionMap)
}
}
Using Java
@WebServlet("/conversation/java")
public class ConversationComponentsSampleJava extends HttpServlet {
private static final Logger logger = Logger.getAnonymousLogger();
Function1<DialogflowApp, Object> welcome = app -> {
app.ask(app.buildRichResponse()
.addSimpleResponse("Hi there from Java!", "Hello there from Java!")
.addSimpleResponse(
"I can show you basic cards, lists and carousels as well as suggestions on your phone",
"I can show you basic cards, lists and carousels as well as suggestions")
.addSuggestions("Basic Card", "List", "Carousel", "Suggestions"), null);
return Unit.INSTANCE;
};
Function1<DialogflowApp, Object> normalAsk = app ->
app.ask("Ask me to show you a list, carousel, or basic card");
Function1<DialogflowApp, Object> suggestions = app ->
app.ask(app.buildRichResponse(null)
.addSimpleResponse("This is a simple response for suggestions", null)
.addSuggestions("Suggestion Chips")
.addSuggestions("Basic Card", "List", "Carousel")
.addSuggestionLink("Suggestion Link", "https://assistant.google.com/"));
private Map<String, Function1<String, Object>> intentMap = new HashMap() {{
put(ConversationComponentsSampleKt.WELCOME, welcome);
put(ConversationComponentsSampleKt.NORMAL_ASK, normalAsk);
put(ConversationComponentsSampleKt.SUGGESTIONS, suggestions);
}};
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
DialogflowAction action = new DialogflowAction(req, resp);
action.handleRequest(intentMap);
}
}
Extending to other Platforms
Dialogflow can be integrated with other platforms, such as Facebook Messenger, Slack, etc. Actions-on-Goolge-kotlin can be extended and data for those platforms returned from your webhook. To do this, simply add to the data for your platform using the app.data function. This must be done before calling the ask function.
val app = DialogflowAction(resp, req, gson)
val facebookResponse = //build response with your choice of method
app.data {
this["facebook"] = facebookMessages
}
app.ask("Hello facebook users!")
The objects in the data object will be passed to the original platform. It may also be used to send custom data back in the response to the /query rest endpoint. More info on this is in the Dialogflow docs.
License
See LICENSE.md.
*Note that all licence references and agreements mentioned in the actions-on-google-kotlin README section above
are relevant to that project's source code only.