Skip to content

Latest commit

 

History

History
94 lines (61 loc) · 3.45 KB

README.md

File metadata and controls

94 lines (61 loc) · 3.45 KB

TYPE VERSION STATUS COVERAGE
demo demo Latest demo Build Status Coverage Status
interactive-chat library Latest version Build Status Coverage Status

Check: VUI SDK

A component to create a conversational flow interface for mobile apps that supports interactions in both UI and Voice.

Why choosing this library?

  • Ability to create a conversational flow
  • Combines voice capabilities with the UI
  • Contains several Node Components ready to use
  • You can personalize the experience with your own callbacks

Prerequisites

The SDK works on Android version 5.0 (Lollipop) and above. (for lower versions contact us)

Dependencies

repositories { 
    
    // Optional. Access to early versions not yet published.
    maven { url "https://dl.bintray.com/chattylabs/maven" }
}

dependencies {

    // Required
    implementation 'com.chattylabs.sdk.android:interactive-chat:<latest version>'
}

How to create a Chat flow?

The following only illustrate a manual way to generate and start a conversation between the app and the user.

val component = InteractiveChatComponent.Builder()
                        .withViewComponent(recyclerView)
                        .withVoiceComponent(voiceComponent)
                        .build()
 
with(component) {

    // Add nodes
    addNode(TextMessage.Builder("message_id_1").setText(R.string.message1).build())
    addNode(ActionText.Builder("action_ok").setText(R.string.ok).build())
    addNode(ActionText.Builder("action_ok").setText(R.string.ko).build())
    
    addNode(TextMessage.Builder("message_id_2").setText(R.string.message1).build())
    addNode(ActionText.Builder("action_one").setText(R.string.one).build())
    addNode(ActionText.Builder("action_two").setText(R.string.two).build())

    // Setup the flow
    with(prepare()) { 

        // Build the relationship
        from("message_id_1").to("action_ko", "action_ok")

        from("action_ok").to("message_id_2")

        from("message_id_2").to("action_one", "action_two")
        
        // Setup the Speech and start the flow
        setupSpeech(context, status -> start(getNode("message_id_1")))
    }
}

Personalize the experience

Wiki

Check the wiki to see how you can create your own custom Node Components