Dialog API module to connect Aimybox powered assistant to the Google Dialogflow agent.
- Create a Dialogflow agent that recognises corresponding user intents
- Obtain a service account JSON of your Dialogflow agent
- Add this JSON file to your Android project's raw folder (with "account.json" name for example)
- Add dependencies to your module's build.gradle:
repositories {
maven("https://dl.bintray.com/aimybox/aimybox-android-sdk/")
}
dependencies {
implementation("com.justai.aimybox:core:${version}")
implementation("com.justai.aimybox:dialogflow-api:${version}")
}
- Provide Dialogflow component into Aimybox configuration object:
fun createAimybox(context: Context): Aimybox {
val locale = Locale.getDefault()
val textToSpeech = GooglePlatformTextToSpeech(context, locale) // Or any other TTS
val speechToText = GooglePlatformSpeechToText(context, locale) // Or any other ASR
val dialogApi = DialogflowDialogApi(context, R.raw.account, locale.language)
val config = Config.create(speechToText, textToSpeech, dialogApi)
return Aimybox(config)
}
Dialogflow can response with simple text as well as Google Assistant's suggestion buttons and basic cards. You can use these types because Aimybox converts it into images, texts, buttons and links.
There is a full Aimybox documentation available here