Skip to content

Quick Start

Dmitriy Chechyotkin edited this page Oct 14, 2020 · 27 revisions

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.

1. Create JAICF project in JAICP

Log in to JAICP Application Panel and then create new JAICF project in the list of your projects.

Create project in JAICP

2. Create a Chat Widget channel

This channel is great for testing and 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.

Create chat widget channel

You can config the look and feel of the widget as you wish. We recommend to check "Send /start" and "Show close controls".

3. Create a new project with code

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.

Template project

Create a new project using File > New > Project from version Control from the menu. Paste this template's URL jaicf-jaicp-caila-template and click Clone.

4. Import CAILA NLU model

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.

5. Test it!

  1. Copy your API token from Project Settings in JAICP Application Panel
  2. Paste it into src/main/conf/jaicp.properties of your source code
  3. Run PollingConnection.kt
  4. Go to the Channels and click on Test of the Web widget channel
  5. Try it in action!

Video

Dive into the code

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.

How to make changes

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

Where to go next

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:

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.

Clone this wiki locally