Oortone
Oortone

Reputation: 185

Webhook and javascript for DialogFlow, where do I find documentation?

I'm trying to learn DialogFlow (Google assistant) and I'm not so experienced in Javascript. I'm looking at various examples like Build Actions for the Google Assistant Level 2, 3 e.t.c.

But it's like you're supposed to know already how the javscript side of things (the code deployed to Firebase, Node.js) works. I've found the API reference but it's very extensive. I just want to look up things from the Javascript code examples – say, like a description of the method .intentin the dialogFlow object and which other methods there are in this class. But I've no idea where to find things like this. When I search I end up in the wrong places.

Upvotes: 0

Views: 42

Answers (1)

Prisoner
Prisoner

Reputation: 50711

Part of what the issue may be is that you're mixing up two different, but related, technologies. Actions on Google are the tools for building for the Google Assistant. It can use Dialogflow as its Natural Language Processing system, and most people do, but it doesn't have to. Similarly, Dialogflow supports the Google Assistant as one of its platforms, but it also supports other platforms.

Adding to this confusion is that each has their own library that is targeted for their specific needs. The codelabs that you pointed to use the "actions-on-google" library, while the documentation link you pointed to goes to the "dialogflow" library.

Documentation for Conversational Actions can be found at https://developers.google.com/assistant/conversational/overview. Under the reference page there, you'll find a link to the documentation for the library (and rather than following this link, you should go to the developers page, since this links to a specific version of the library). You may find this documentation difficult to read, since it has classes that aren't relevant to you, but are there to abstract away differences between different version of the Actions on Google and Dialogflow protocols.

That documentation, however, can be a little difficult to read. It doesn't make clear, for example, that the typical lines to setup the application

const {dialogflow} = require('actions-on-google');
const app = dialogflow({debug: true});

are creating an instance of a DialogflowApp. Or that the object that is passed to your handler and typically named "conv":

app.intent('Default Welcome Intent', (conv) => {
  // Do things
});

is an instance of DialogflowConversation.

Upvotes: 1

Related Questions