Wednesday, August 31, 2016

BotKit Questionnaires

questionnaires are the ChatBot equivalent of forms, where user interaction is better served with simple UI elements such as buttons.
A questionnaire is a list of questions of various types that Eva will ask the end user. As a questionnaire is an interactive message it can only be the last in the list of returned messages and there can only be a single interactive message in the list.
To request asking the end user questions, return the following interactive message from any applicative webhook:



The "_type" of the message is always: "QuestionnaireEvent"

"questionnaireAnsweredHook" is an enumeration of the webhook to call when the questions have all been answered. "payload" is an object that will be added to the payload of the "questionnaireAnsweredHook".

"questionnaireAbortedHook" has the same structure of a "questionnaireAnsweredHook". A "questionnaireAbortedHook" will be called if the validation of an open "QuestionMessage" fails three times.
This key is optional.

Send 1 or more questions, of any of the supported types in the list of "questions".
In this example there are 3 questions.
Each question has a "name" which will be the key of the result in the payload to be delivered to the "questionnaireAnsweredHook".

The 1st question in the example is an EmailQuestion.
The open reply will be validated using a built-in regular expression for email addresses.
Eva will then send out an email to the designated address to make sure the submitted email is valid and owned by the end user!
The 2nd question in the example is a multiple choice question, typed "MultiChoiceQuestion" with 3 choices.

The 3rd question in the example is an open question for which you may request a validation regular expression.

As usual, this functionality works across all messaging platforms! Facebook Messenger, Telegram, Kik, Line, Skype etc.

Detailed docs can be found here: http://docs.evature.com/botkit.html#interactive-message-questionnaires

Happy Botting!

Sunday, August 7, 2016

BotKit OAuth Login

When a user starts a conversation with your business, you may want to identify her as a customer who already has an account with your business. To help with this, we have created a platform-agnostic secured protocol to link and unlink the messaging end-user identity with your business user identity.

OAuth-style LogIn allows you to invite users to log-in using your existing authentication flow thus to provide a more secure, personalized and relevant experience to users.

To request a Log In return a special message of type LoginOAuthEvent from any applicative webhook.
As this is an interactive message it can only be the last in the list of returned messages and there can only be a single interactive message in the list.

Here is an example of such a reply:

{
    "botkitVersion": "0.3.0", 
    "messages": [
        {
            "_type": "LoginOAuthEvent", 
            "loginSuccessHook": {
                "webhook": "flight_boarding_pass"
            }, 
            "text": "Please Login in first", 
            "webLoginUrl": "https://chat.evature.com/demo_login"
        }
    ]
}
  • _type - Must be LoginOAuthEvent
  • loginSuccessHook - a JSON object with either webhook - an enumeration of an existing webhook, or url
  • text - any text message - mandatory.
  • webLoginUrl -  a URL to the web login page.
The end user will be presented with a log in request. Once she clicks on it she will be redirected outside the messaging platform and into the a web browser window with the business specific log in process.

The URL webLoginUrl will be extended with a query parameter called redirect_uri.
If the log in is successful, redirect the browser to the redirect_uri specified in your callback to complete the flow, and append a new authorization_code query parameter. Eva will add the contents of authorization_code to the subsequent
applicative webhook calls as a new key called loginData.

Detailed BotKit docs can be found here: http://www.evature.com/docs/botkit.html

Tuesday, June 28, 2016

Introducing the Eva Travel BotKit

The Eva BotKit enables building a single AI assisted Bot for providing applicative Travel functionality across all messaging platforms with a bot platform API. BotKit bundles Eva’s Natural Language Understanding and nonlinear Dialog Management features with robust cloud based spelling correction. Furthermore, the Eva API reply is automatically parsed and dialog is handled by Eva. The backend application is only called upon to implement applicative directives, such as ShowBoardingPass or PerformFlightSearch. Applicative integration is done via fully customizable webhooks. Eva automatically reformats your applicative webhook replies to comply with all quirks of the different messaging platforms so you don’t have to integrate separately with each one.

It takes 5 minutes to get your new Bot to answer Hellos on Facebook Messenger, Telegram LINE or Kik!


Integration with all messaging platforms consists of the following steps:

  1. Create a new Bot
  2. Add a Chat Service Integrations
  3. Implement applicative webhooks

The BotKit provides seamless integration with the following platforms:
  • Facebook Messenger
  • Telegram
  • LINE
  • Kik
  • WeChat (Beta)
  • Slack (Beta)
  • SMS (Beta)


Eva defines many webhook functions for applicative requests that may be queried by the end users. This is usually existing functionality in your backend servers that the developer needs to “wire” to the corresponding webhook post.
Here are some examples:
  • Perform a Flight Search
  • Perform a Hotel Search
  • Show a Boarding Pass
  • Show an Itinerary
You can simply ignore the applicative webhooks that are non-applicable to your backend. Eva will automatically reply to end users explicitly requesting these services with a “not supported” message.



To get started, log in to https://chat.evature.com/botkit using your Eva credentials.
For free API access please register here:

Detailed docs available there: http://www.evature.com/docs/botkit.html

Enjoy botting!

Sunday, May 1, 2016

VoiceKit for Android update - version 2.1.424



We've just released a new version of VoiceKit for Android - 2.1.424.

Features:
  1. Return EvaResult from the applicative callbacks -
    This version allows returning a custom reply from the applicative callbacks, thus allowing the application to modify the text spoken or displayed by Eva.
    This allows for new types of integrations, for example - allowing the application to answer questions asked by the user.
  2. Example App -
    the SDK is now bundled with a simple example app, featuring the different applicative interfaces and different return values.

We've also started using the jitpack.io artifact repository.  This allows the developers to setup a specific version in the build.gradle file or use the latest version - and Gradle will handle fetching the needed dependencies.

To use it follow these two steps:

  1. Add justpack.io repository:
    In your root build.gradle at the end of the allprojects repositories:
    maven { url "https://jitpack.io" }
  2. To  your app build.gradle dependencies add one of the following:
    compile 'com.github.evature:android:2.1.424'

    // or for the latest backwards compatible version:
    compile 'com.github.evature:android:2.0.+'  

    // or for the latest and greatest version:
    compile 'com.github.evature:android:master-SNAPSHOT'   


Note this version (2.1.+)  is NOT backwards compatible. 
However, it should be a very small effort to update the code to compile with the new version.

The non compatible changes include:
  1. App interfaces are are now prefixed with "Eva" (eg. EvaHotelSearch instead of HotelSearch).
    Since Java does not allow import aliasing, this will eliminate the problem of having similar named classes in the app.
  2. The different fields in the Eva classes are now consistently camel case (as per Java coding standards).
  3. App search interface function parameters are slightly different - instead of passing many parameters to the search function, an "attributes" object is passed which contains different attributes.
    eg.  instead of using the "minStars" parameter use "attributes.minStars".
  4. The app interface functions now return an EvaResult class and are not void functions. Simply return null for the default behaviour.



For any questions or requests, please don't hesitate to ask.

Monday, October 19, 2015

Introducing the Eva VoiceKit for iOS

Screenshot of the Eva VoiceKit for iOS
A few months ago we introduced the Eva VoiceKit for Android and today we are adding an iOS library with the same functionality. Use VoiceKit to voice-enable a travel application in a few of hours of simple integration.

VoiceKit for iOS is a culmination of many iPhone integrations of the Eva Speech Recognition and Natural Language Understanding SDK with mobile Travel applications.

Eva VoiceKit for iOS comes batteries-included and bundles everything a travel application application needs:
  • Very large vocabulary cloud-based DNN Speech Recognition
  • Deep Learning based Natural Language Understanding
  • Dialog Management - Eva automatically asks questions and converses with the end users in natural language
  • Beautiful Voice Chat User Interface Overlay with Semantic Highlighting
  • Insights and Analytics Dashboard
By lowering the barrier to entry to voice enabling Travel applications we addressed the #1 customer concern with expensive development resources.
Achieve complete voice integration in less than a single developer-day.
With the Eva VoiceKit for iOS you can add a cutting edge voice interface to an iOS travel application with super simple integration.

Take advantage of the precision of the latest Deep Learning algorithms delivering near human intelligence.

The user interface includes informative animations while conforming to the latest design guidelines and is fully customizable to match the travel application's theme.

The SDK is open source and is available for immediate downloads at https://github.com/evature/ios

Fork us on Github!



PS - A PhoneGap (Apache Cordova) version of VoiceKit for iOS and for Android is coming soon!

Monday, July 13, 2015

Introducing the Eva VoiceKit for Android


Voice enable your travel application in a couple of hours using the latest Eva VoiceKit SDK.
The VoiceKit is a culmination of many integrations of the Eva Speech Recognition and Natural Language Understanding SDK with mobile Travel applications.
The Eva VoiceKit comes batteries-included and bundles everything your application needs:
  • Speech Recognition
  • Natural Language Understanding
  • Dialog Management
  • Voice Chat User Interface Overlay with Semantic Highlighting
  • "OK Google" Integration
  • Insights and Analytics Dashboard
We tried to lower the barriers to entry to voice enabling Travel applications, and the #1 customer concern was expensive development resources.
Our goal is to achieve complete integration in less than a single developer-day.
With this new release you can add a cutting edge voice interface to your travel application with super simple integration.

Take advantage of the precision of the latest Deep Learning algorithms delivering near human intelligence.

The beautiful user interface conforms to the latest Material Design guidelines and is fully customizable to match your application's theme.

The SDK is open source and is available for immediate downloads at https://github.com/evature/android

Fork us on Github!


Wednesday, January 28, 2015

The fastest route between voice search and your app


A very cool feature you can add to your Android app is integrating with Google's voice search.

When enabled, your users will be able to say to their phone:

  "Ok Google, search for flights from NY to LA on MyCoolTravelApp"

The good news is this integration is very simple, and Eva is a perfect match to parse any text provided by the user.

3 small steps are necessary:

1. To AndroidManifest.xml  change the your Activity entry with:

<activity
            android:name="com.yourcompany.YourSearchActivity"
            android:launchMode="singleTask"    >
      <intent-filter>
           <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
           <category android:name="android.intent.category.DEFAULT"/>
      </intent-filter> 
</activity> 

2. To your search activity - add:

@Override
protected void onNewIntent(Intent intent) {
     super.onNewIntent(intent);
     setIntent(intent);
}

3. at the end of onResume method add:

Intent intent = getIntent();
if ("com.google.android.gms.actions.SEARCH_ACTION".equals(intent.getAction())) {
         // search from Google Voice Search:
         // similar to clearing session and then handling voice-recognition results
         eva.resetSession();
         eva.stopSearch();
      
         // When starting a new session you'd want to clear the chat screen
         clearChatHistory();
         String searchString = intent.getStringExtra(SearchManager.QUERY);|
         // Add the user chat and initiate an eva search
        addUserChat(searchString);
        eva.searchWithText(searchString, null, false);
        // clear the intent - it shouldn't run again when resuming
       onNewIntent(new Intent());
}

Note:
  1. If your search activity is not the top level activity in your app you may wish to setup a back stack - see the relevant Android documentation.
  2. The Google Voice integration will not work until you publish your app to the Play store with the updated AndroidManifest.
    To test it can send the intent via adb, for example:
    adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION -e query Flights from NY to LA <app package name here>