Skip to main content

Connecting Aimybox to JAICF project

In addition to JAICP, we provide the Aimybox platform. Using this platform you can teach any device to listen and talk to the user. To do this, you can create a project in Aimybox, enable the necessary voice functions in it, and then integrate it into your device. You can choose Android SDK, iOS SDK, or HTTP API.

In this case, you can use any speech recognition and synthesis systems that are supported in Aimybox, or connect your own solution.

To connect the Aimybox channel to the JAICF project, please follow these steps:

  1. Prepare the project.
  2. Create the channel.
  3. Create a skill in the Aimybox console.
  4. Test the skill.

Prepare the project

Before connecting the channel, prepare the JAICF project in advance:

  1. Specify the following dependencies in the build.gradle.kts file:
dependencies {
// ...
implementation("com.just-ai.jaicf:jaicp:$jaicfVersion")
implementation("com.just-ai.jaicf:aimybox:$jaicfVersion")
}
tip
Don’t forget to substitute $jaicfVersion with the latest framework version.
  1. Configure platform connection method:
  • long polling — the bot will connect to the Just AI server when interacting with the platform. It is a simple solution, convenient for local development and debugging.

    For this method, specify AimyboxChannel in the JaicpPoller.kt file:

package com.just-ai.jaicf.template.connections

fun main() {
JaicpPollingConnector(
templateBot,
accessToken,
channels = listOf(
ChatApiChannel,
ChatWidgetChannel,
TelephonyChannel,
AimyboxChannel
)
).runBlocking()
}
  • webhook — the bot will receive messages from the platform using the specified link. Must be configured to connect JAICP Cloud.

    For this method, specify the channel AimyboxChannel in the JaicpServer.kt file:

package com.just-ai.jaicf.template.connections

fun main() {
JaicpServer(
botApi = templateBot,
accessToken = accessToken,
channels = listOf(
ChatApiChannel,
ChatWidgetChannel,
TelephonyChannel,
AimyboxChannel
)
).start(wait = true)
}

Create the channel

Open the JAICF project on JAICP. Go to the Channels tab on the side panel, then click Inbound → Connect channel. In the Others section, choose Aimybox. Specify the channel name and click Create.

Click Get webhook under the name of the newly created channel. It will be copied to the clipboard. The copied webhook will be needed later when configuring the skill.

Create a skill

Sign in to the Aimybox console. To create a skill using the console, click Create skill and fill in the following parameters:

  • Skill name — specify the channel name.
  • Skill samples — specify one or more phrases that will be used to launch a skill

Next, choose Aimylogic as a supported source. In the Aimylogic webhook URL field paste the copied earlier webhook.

Click Save skill.

Test the skill

In a few seconds, you can test how your skill works. To do this, after completing the training, click Try it in action. Enter in the field one of the activation phrases that you specified when creating the skill.