npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jovo-platform-dialogflow

v3.6.1

Published

> To view this page on the Jovo website, visit https://v3.jovo.tech/marketplace/jovo-platform-dialogflow

Downloads

319

Readme

Dialogflow Platform Integration

To view this page on the Jovo website, visit https://v3.jovo.tech/marketplace/jovo-platform-dialogflow

Learn how to bring your Jovo apps to platforms like Facebook Messenger and Slack by using Dialogflow integrations.

Introduction to Dialogflow Integrations

If you have an existing Dialogflow Agent (which you can set up using the Jovo Model) and the Jovo CLI, you can enable integrations in the Dialogflow console:

Dialogflow Integrations

Configuration

To enable a Dialogflow integration in your code, import the jovo-platform-dialogflow package and then register the integrations with the app.use method:

// @language=javascript

// src/app.js

const { Dialogflow, FacebookMessenger, Slack } = require('jovo-platform-dialogflow');

app.use(
    new Dialogflow().use(
        new Slack(),
        new FacebookMessenger()
    )
);

// @language=typescript

// src/app.ts

import { Dialogflow, FacebookMessenger, Slack } from 'jovo-platform-dialogflow';

app.use(
    new Dialogflow().use(
        new Slack(),
        new FacebookMessenger()
    )
);

The example above shows how both Slack and Facebook Messenger are added as plugins of the Dialogflow class, with an additional use call.

Platforms

Facebook Messenger

Official Dialogflow Docs: Facebook Messenger Integration

Dialogflow Integrations: Facebook Messenger

You can use this Dialogflow integration to build bots for Facebook Messenger. Learn more about the setup process in the official Dialogflow docs.

For platform-specific output, you can add custom payload (learn more below) with the facebook attribute. Learn more about Facebook Messenger output in the official Facebook docs.

Slack

Official Dialogflow Docs: Slack Integration

Dialogflow Integrations: Slack

You can use this Dialogflow integration to build Slack bots. Learn more about the setup process in the official Dialogflow docs.

For platform-specific output, you can add custom payload (learn more below) with the slack attribute. Learn more about Slack bot output in the official Slack docs.

Custom Payloads

Official Dialogflow Docs: Custom Payloads

To extend the responses with platform-specific output, you can add custom payloads to the Dialogflow response:

// @language=javascript

this.$dialogflowAgent.setCustomPayload(platform, payload)

// @language=typescript

this.$dialogflowAgent!.setCustomPayload(platform: string, payload: object)

You can find the right attributes to pass to the method in the official Dialogflow docs. For example, you can add Facebook Messenger Quick Replies like this:

// @language=javascript

// src/app.js

app.setHandler({

   HelloWorldIntent() {
      this.$dialogflowAgent.setCustomPayload('facebook', {
         "quick_replies": [
               {
                  "content_type": "text",
                  "title": "Joe",
                  "payload": "Joe",
               },
               {
                  "content_type": "text",
                  "title": "Samantha",
                  "payload": "Samantha",
               },
               {
                  "content_type": "text",
                  "title": "Chris",
                  "payload": "Chris",
               }
         ]
      });
      this.ask('Hello World! What\'s your name?', 'Please tell me your name.');
   },

   // ...

});

// @language=typescript

// src/app.ts

app.setHandler({

   HelloWorldIntent() {
      this.$dialogflowAgent!.setCustomPayload('facebook', {
         "quick_replies": [
               {
                  "content_type": "text",
                  "title": "Joe",
                  "payload": "Joe",
               },
               {
                  "content_type": "text",
                  "title": "Samantha",
                  "payload": "Samantha",
               },
               {
                  "content_type": "text",
                  "title": "Chris",
                  "payload": "Chris",
               }
         ]
      });
      this.ask('Hello World! What\'s your name?', 'Please tell me your name.');
   },

   // ...

});