Skip to content

Latest commit

 

History

History
 
 

dialogflow-api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Dialogflow API connector for Aimybox Android SDK

Dialog API module to connect Aimybox powered assistant to the Google Dialogflow agent.

How to start using

  1. Create a Dialogflow agent that recognises corresponding user intents
  2. Obtain a service account JSON of your Dialogflow agent
  3. Add this JSON file to your Android project's raw folder (with "account.json" name for example)
  4. 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}")
    }
  1. 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)
    }

Supported response types

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.

Documentation

There is a full Aimybox documentation available here