Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between ActionsSdkApp and DialogflowApp for Google Assistant

In order to build a Google Assistant app, Google provides two different APIs as part of their node.js actions-on-google library :

  • ActionsSdkApp
  • DialogflowApp

There have a common interface, but I don't understand what the difference is between the two and why I would use one or the other.

like image 422
Antoine Avatar asked Dec 18 '17 21:12

Antoine


People also ask

What is actions SDK?

The Actions SDK is a method of developing conversation fulfillment without using Dialogflow. When using the Actions SDK, you use an Action package to map intents to their fulfillment. You must also provide query patterns in the Action package in order to define example phrases your users might say.

Does Google Assistant use Dialogflow?

The Google Assistant Conversational Actions development platform is a built-in conversation builder, and it does not integrate with Dialogflow.


2 Answers

In short, these two objects provide similar (although not identical) methods to handle requests and provide results for two default ways Google allows you to build an Action for the Assistant.

The DialogflowApp object is the one you will likely use for most purposes. It is meant to work with the Dialogflow tool, letting it handle the Natural Language Processing (NLP) components and passing the results, where appropriate, to your webhook. It provides a few methods that are specific to Dialogflow features, such as Contexts, and maps other things to the response format that Dialogflow expects.

The ActionsSdkApp is meant to be used if you are using your own NLP and your webhook is getting things directly from Google (without using Dialogflow). If you need to build an actions.json file, you're using the Actions SDK.

Both have common methods and idioms, such as app.ask() and app.tell() and mapping app.data to session storage and so forth, even if the details of implementing these are different for each type.

You should be using the one that matches the tool that you're using. For most new users - that will likely be Dialogflow and the DialogflowApp object.

Update

Note that the API in the question, the specific objects asked about, and the specific methods talked about in my answer are for the previous version of the library.

The concept of when to use the ActionSDK vs Dialogflow objects in the current library still hold, so the concept behind this question and answer are still valid, but the technical details have changed.

Update - Jun 2020

The library in question is now deprecated, since it no longer works with the current version of Actions on Google (Actions Builder/SDK AoG v3). It still works with Dialogflow (which uses AoG v2) and if you're still using the AoG v2 Actions SDK.

like image 93
Prisoner Avatar answered Oct 08 '22 10:10

Prisoner


IN SIMPLE TERMS

Use the Actions SDK for one-shot apps. These are apps that provide the required answer directly after being invoked and then stop. They give you just this one result. A typical example would be setting a timer to ten minutes.

Use the Dialogflow for all other apps, for those that are really conversational, where there are multiple paths to follow and where you want your user to provide more information during the conversation.

like image 24
Rahil B Rasheed Avatar answered Oct 08 '22 10:10

Rahil B Rasheed