-
Notifications
You must be signed in to change notification settings - Fork 39
Quick Start
This tutorial shows how it's easy to create your first JAICF bot with JAICP and CAILA NLU.
JAICP (Just AI Conversational Platform) provides a lot of features for conversational applications developers, like CAILA NLU service, multiple integrations including telephony, text messengers, voice assistants and live operators, cloud hosting and dialogue analytics.
Log in to JAICP Application Panel and create a new JAICF project in the list of your projects.
This is a great channel for testing and moreover it also can be customised and installed to any website. Go to the Channels from the left menu bar and create new Chat Widget channel in the Incoming channels section.
This is a time to create some logic of your chatbot. To create a new Kotlin project, you have to have some appropriate IDE installed. We recommend to use IntelliJ IDEA due its native support of Kotlin language.
There is a ready to use JAICF project template available on Github. You have to Fork it, or create your own Github repo using this template (click on green button named Use this template).
Once you've forked a template, create a new project from your Github repo. Click on Create from Github in your IntelliJ IDEA and provide your Github repo URL. Click Clone then.
After few moments a new project will be cloned and configured automatically.
Once the project has been cloned, you have to provide an access token of your JAICP project to establish connectivity between your code and JAICP.
Go to your project in JAICP Application Panel, open Project properties and copy API token from Location tab. Then return to the IntelliJ IDEA and paste this token to the jaicp.properties file.
All preparations are done! You've created a new JAICP project, cloned a template and linked your bot's code to the JAICP. Now it's time to test it.
Just run JaicpPoller.kt
file from your IntelliJ IDEA. Once it's ran, go back to the Channels page in the JAICP Application Panel and click Test button.
This opens your chat widget and automatically sends the first request to your local machine. Try to type some messages to see how your bot responds.
Template project contains a ready to use model for CAILA NLU. It's placed in the file named caila_import.json in the root directory.
Click on the cog in the top right corner, select Project properties -> Classifier -> Import CAILA project. Select caila_import.json file from your disk and click on Save button.
This appends one more intent named Smalltalk to your NLU model.
- Copy your API token from Project Settings in JAICP Application Panel
- Paste it into
src/main/resources/jaicp.properties
of your source code - Run
JaicpPoller.kt
- Go to the Channels and click on Test of the Web widget channel
- Try it in action!
You've created your very first JAICF project. By fact this project utilises JAICP features like CAILA NLU (to recognise user inputs) and channels (web widget in our example).
Running locally on your PC, JAICF application connects to the JAICP project via JaicpPollingConnector
and retrieves all messages from the users who wrote something in web widget. Once received the message, JAICF sends it to the CAILA NLU to recognise an intent and then processes this intent through the MainScenario
activating an appropriate state and its action.
Now you may change your JAICF code and re-run it to see how responses are changed. For example, you can change reactions of your states, or add more intents to the CAILA model in the JAICP project and learn how to catch up these intents in your code.
Learn how JAICP transparently logs every interaction between the user and your chat bot, storing it to the Analytics -> Dialogs section in JAICP Application Panel
In this quick start guide you've learned how to create a new JAICF project with JAICP integration and simple dialogue scenario, there are so many things to learn about framework itself, like:
- cross-platform support
- managing a dialogue state
- automatic testing
- and much more
You may also would like to learn another version of this Quick start if you're familiar with Google Dialogflow tool. It covers the same steps but with Dialogflow usage.
To dive into the JAICF, we recommend to go next through the Introduction section, FAQ and check for some JAICF project examples.