Skip to content

JAICP Cloud

Dmitriy Chechyotkin edited this page Oct 28, 2020 · 9 revisions

JAICP Cloud

JAICP (Just AI Conversational Platform) provides a cloud hosting to serve JAICF projects. This makes it much easier to use this solution to automatically build and deploy JAICF project from source codes.

Example

Here is a ready to use template that can be deployed to JAICP Cloud. Please investigate its build.gradle.kts and JaicpServer.kt to learn how to configure your JAICF project to make it compatible with JAICP Cloud.

How to use

There are simple steps you have to make to deploy your JAICF project to JAICP Cloud.

1. Create main class

JAICP expects your JAICF project to be ran in special way using JaicpServer. Thus you have to create main class that utilises this class the next way:

fun main() {
    JaicpServer(
        botApi = templateBot,
        accessToken = accessToken,  // JAICP project API token
        channels = listOf(          // List of configured JAICP channels
            ChatApiChannel,
            ChatWidgetChannel,
            TelephonyChannel
        )
    ).start(wait = true)
}

2. Add JAICP build plugin

JAICP builds your JAICF project automatically. To make it possible you have to append a special plugin to your build.gradle.kts:

plugins {
    application
    kotlin("jvm") version "1.3.71"
    id("com.justai.jaicf.jaicp-build-plugin") version "0.1.1"
}

And configure main class that utilises JaicpServer:

application {
    mainClassName = "com.justai.jaicf.template.connections.JaicpServerKt"
}

Learn more about JAICP build plugin here

3. Push your JAICF project to Git repository

JAICP fetches projects only from any Git repositories like Github. Thus you have to push your project's sources to some Git repository before you can deploy it to JAICP.

4. Create JAICF project on JAICP

In your JAICP Application Panel create a new JAICF project with JAICP Cloud in Runtime environment section and External template in Initial code section. Then paste your JAICF project's Git repository URL and click Create.

Deploy to JAICP Cloud

5. Append channels

On the Channels panel add required channels.

Note that you have to append only those types of channels that are presented in your JaicpServer configuration.

Once the very first channel is created, JAICP automatically starts to build and deploy your project.

6. Push changes to source codes

Once you're ready with some changes, you just have to push it to the same Git repository - JAICP automatically fetches and deploys these changes to the Cloud.

Analytics and Logs

JAICP transparently stores every user's request to your bot and responses returned from it. To make it possible you have to append some special conversation loggers to your BotEngine configuration:

val templateBot = BotEngine(
    model = MainScenario.model,
    conversationLoggers = arrayOf(
        JaicpConversationLogger(accessToken),
        Slf4jConversationLogger()
    ),
    activators = arrayOf(
        CailaIntentActivator.Factory(cailaNLUSettings),
        RegexActivator
    )
)

Logs

You can find real-time logs generated by your bot at Logs tab (bottom panel).

Dialogs

There are also dialogs between users and the bot available on the Analytics -> Dialogs of the left panel.

You can find it very useful to append unresolved phrases to new or existing CAILA intents using Phrases tab. This speed-ups the daily intents improvement routine.

You can learn more about Dialogs feature here.

Clone this wiki locally