<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Onwuka Gideon</title>
    <description>The latest articles on DEV Community by Onwuka Gideon (@dongido).</description>
    <link>https://dev.to/dongido</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F25490%2Febc16af6-7494-44b5-9880-a20ea20411ab.jpeg</url>
      <title>DEV Community: Onwuka Gideon</title>
      <link>https://dev.to/dongido</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dongido"/>
    <language>en</language>
    <item>
      <title>Adding Chatbots to Your Stream Chat App Using Google’s Dialogflow</title>
      <dc:creator>Onwuka Gideon</dc:creator>
      <pubDate>Mon, 27 May 2019 20:42:49 +0000</pubDate>
      <link>https://dev.to/dongido/adding-chatbots-to-your-stream-chat-app-using-google-s-dialogflow-1b46</link>
      <guid>https://dev.to/dongido/adding-chatbots-to-your-stream-chat-app-using-google-s-dialogflow-1b46</guid>
      <description>&lt;h1&gt;
  
  
  Adding Chatbots to Your Stream Chat App Using Google’s Dialogflow
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://getstream.io/blog/adding-chatbots-to-your-stream-chat-app-using-googles-dialogflow/"&gt;https://getstream.io&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most tasks are repetitive and time-consuming. What if we could use a bot to help in doing the tasks instead? This will hugely increase productivity. Chatbots are fantastic for this. &lt;/p&gt;

&lt;p&gt;In this tutorial, I’ll walk you through steps to adding a chatbot to your Stream Chat app using Dialogflow and Vue. At the end of this tutorial, you will build a frequently asked questions (FAQs) bot, be more familiar with Stream Chat API, and the webhook system provided by Stream.&lt;/p&gt;

&lt;p&gt;Here is a preview of what we’ll be building:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oGgsHsuf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558082207354_getsreamChat.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oGgsHsuf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558082207354_getsreamChat.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To follow along with this tutorial comfortably, the following are expected:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A basic understanding of JavaScript&lt;/li&gt;
&lt;li&gt;A basic understanding of &lt;a href="https://vuejs.org/"&gt;Vue.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You should also have &lt;a href="http://Node.js"&gt;Node&lt;/a&gt; installed on your system (version 8.9 or above – preferably the latest 12.x)&lt;/li&gt;
&lt;li&gt;You should have npm or yarn installed on your system&lt;/li&gt;
&lt;li&gt;Have &lt;a href="https://ngrok.com/"&gt;ngrok&lt;/a&gt; installed on your system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have all the above ready, then let’s get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up the Client App – Create a New Vue App
&lt;/h2&gt;

&lt;p&gt;Vue provides a &lt;a href="https://cli.vuejs.org/guide/creating-a-project.html#installation"&gt;CLI&lt;/a&gt; for scaffolding a new Vue project. First, you'll need to install the Vue CLI globally on your system (if you don't have it installed already). After that, we’ll create a new Vue project with CLI commands.&lt;/p&gt;

&lt;p&gt;Next, create a new Vue project by running the following commands in any convenient location on your system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    # Install Vue CLI globally on your system
    $ yarn global add @vue/cli

    # Create a new Vue project (for the prompt that appears, press enter to select the default preset.)
    $ vue create faqx

    # Change your directory to the project directory
    $ cd faqx

    # Install Stream Chat client SDK
    $ yarn add stream-chat

    # Install axios - a library for making request
    $ yarn add axios

    # Run the app!
    $ yarn serve

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Accessing the &lt;a href="http://localhost:8080"&gt;URL&lt;/a&gt; displayed on your terminal will take you to a Vue default page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Your Stream Chat Keys
&lt;/h2&gt;

&lt;p&gt;To start using the Stream Chat API, you need to have an API key. &lt;/p&gt;

&lt;p&gt;Create an account &lt;a href="https://getstream.io/accounts/signup/"&gt;here&lt;/a&gt; or &lt;a href="https://getstream.io/accounts/login/"&gt;log in&lt;/a&gt; if you already have an account. &lt;/p&gt;

&lt;p&gt;Then, from your &lt;a href="https://getstream.io/dashboard"&gt;dashboard&lt;/a&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new app using any convenient name. I will call mine “FAQ”&lt;/li&gt;
&lt;li&gt;Fill in the &lt;strong&gt;App Name&lt;/strong&gt; as “FAQx" or any name you wish&lt;/li&gt;
&lt;li&gt;Finally, submit the form by clicking on the &lt;strong&gt;Submit&lt;/strong&gt; button to create the app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Nib8CW5u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558025079426_Screenshot%2B2019-05-16%2Bat%2B5.36.10%2BPM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Nib8CW5u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558025079426_Screenshot%2B2019-05-16%2Bat%2B5.36.10%2BPM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the app is created, you will be provided with some options on your dashboard. Select &lt;strong&gt;Chat&lt;/strong&gt; to go the Stream Chat dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6x2W12Sx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558025492908_Screenshot%2B2019-05-16%2Bat%2B5.50.06%2BPM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6x2W12Sx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558025492908_Screenshot%2B2019-05-16%2Bat%2B5.50.06%2BPM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, check &lt;strong&gt;Disable Permissions Checks&lt;/strong&gt; and then click on the &lt;strong&gt;Save&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;Then, scroll to the bottom of the page and take note of your App Access Keys – &lt;strong&gt;Key&lt;/strong&gt; and &lt;strong&gt;Secret.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dZhK4Sx0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558025727418_Screenshot%2B2019-05-16%2Bat%2B5.52.26%2BPM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dZhK4Sx0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558025727418_Screenshot%2B2019-05-16%2Bat%2B5.52.26%2BPM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, create a &lt;code&gt;.env&lt;/code&gt; file in the root directory of the project and update your Stream keys to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    VUE_APP_PORT=3000
    VUE_APP_SERVER=http://localhost:3000

    VUE_APP_KEY=&amp;lt;YOUR KEY&amp;gt;
    APP_SECRET=&amp;lt;YOUR SECRET&amp;gt;

    DIALOGFLOW_PROJECT_ID=&amp;lt;YOUR DIALOGFLOW PROJECT ID&amp;gt;
    GOOGLE_APPLICATION_CREDENTIALS=&amp;lt;GOOGLE SERVICE FILE&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Remember to replace &lt;code&gt;&amp;lt;YOUR KEY&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;YOUR SECRET&amp;gt;&lt;/code&gt; with the correct app keys you have noted above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up the Server
&lt;/h2&gt;

&lt;p&gt;Next, create a new directory named &lt;code&gt;server&lt;/code&gt; in the root directory of the project. Then open up a new terminal and then change your current directory to the &lt;code&gt;server&lt;/code&gt; directory. Then install the following dependencies that we’ll need for the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ yarn add express cors body-parser dialogflow path uuid dotenv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above dependencies include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;express&lt;/code&gt; – A Node framework we are using to build our server&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dialogflow&lt;/code&gt; – Dialogflow’s Node SDK&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dotenv&lt;/code&gt; – An npm package for parsing configs from &lt;code&gt;.env&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/cors"&gt;cors&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/body-parser"&gt;body-parser&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/uuid"&gt;uuid&lt;/a&gt; and &lt;a href="https://www.npmjs.com/package/dotenv"&gt;dotenv&lt;/a&gt; (all excellent npm packages)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, create an Express app by creating a new file named &lt;code&gt;app.js&lt;/code&gt; to the &lt;code&gt;server&lt;/code&gt; directory and then add the following code to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./server/app.js

    const express = require("express");
    const cors = require("cors");
    const bodyParser = require("body-parser");
    const StreamChat = require('stream-chat').StreamChat;
    const dialogflow = require('dialogflow').v2beta1;
    const uuid = require('uuid');

    require('dotenv').config({path:  "../.env"})

    const app = express();
    const port = process.env.VUE_APP_PORT || 3000

    app.use(cors());
    app.use(bodyParser.json());
    app.use(bodyParser.urlencoded({ extended: true }));

    // Initialize Stream Chat SDK
    const serverSideClient = new StreamChat(
        process.env.VUE_APP_KEY, 
        process.env.APP_SECRET
    );

    app.get("/", async (req, res) =&amp;gt; {
        res.send({ hello: "World!" });
    });

    app.listen(port, () =&amp;gt; {
        console.log(`Node app listening on port ${port}!`)
    });
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the code above, after importing the packages that we have installed,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We created an &lt;a href="https://expressjs.com/"&gt;Express&lt;/a&gt; app using &lt;code&gt;const app = express();&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Next, we initialize the Stream Chat SDK&lt;/li&gt;
&lt;li&gt;Then finally, we created an endpoint - &lt;code&gt;/&lt;/code&gt; (&lt;code&gt;app.get('/',…&lt;/code&gt;) for testing to know if the app works. So, if you visit &lt;code&gt;http://localhost:3000/&lt;/code&gt;, you will get a message - &lt;code&gt;{ hello: 'World!'}&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, create a new endpoint for creating a token.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./server/app.js

    app.post('/login', async (req, res) =&amp;gt; {
        const userId = req.body.userId

        if (!userId) {
            return res.status(400).send({
                status: "error",
                message: "username and name is required"
            })
        } 

        return res.status(200).send({
            status: "success",
            token: serverSideClient.createToken(userId)
        })
    });
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The token is required for initializing the Stream Chat SDK.&lt;/p&gt;

&lt;p&gt;Finally, start up the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    node app.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If it starts successfully, you will see a message printed to the terminal - “Node app listening on port 3000!”&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up Dialogflow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dialogflow.com/"&gt;Dialogflow&lt;/a&gt; is a Google-owned developer of human-computer interaction technologies based on natural language conversations. Before you can start using the service of Dialogflow, you need to have an account with them.&lt;/p&gt;

&lt;p&gt;Now head to Dialogflow’s website and create a free &lt;a href="https://console.dialogflow.com/api-client/#/login"&gt;account&lt;/a&gt; if you don’t have one already. You’ll need a google account to be able to create an account. Once you are on the page, click on the sign in with &lt;strong&gt;Google&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;From your dashboard,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an agent by selecting &lt;strong&gt;Create Agent.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Type in the Agent name as &lt;strong&gt;FAQX.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Create&lt;/strong&gt; button to processes the form.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mwB7EsrS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558051874504_Screenshot%2B2019-05-17%2Bat%2B1.05.48%2BAM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mwB7EsrS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558051874504_Screenshot%2B2019-05-17%2Bat%2B1.05.48%2BAM.png" alt="Creating an Agent"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the gear icon, to the right of the agent name.&lt;/li&gt;
&lt;li&gt;Enable beta features and APIs.&lt;/li&gt;
&lt;li&gt;Copy your project ID and update the .env file with it:
DIALOGFLOW_PROJECT_ID=&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Save&lt;/strong&gt; button to save your changes&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;GOOGLE PROJECT&lt;/strong&gt; section, click on the name of the &lt;strong&gt;Service Account&lt;/strong&gt;. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gcS7Gu1K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558079212528_Screenshot%2B2019-05-17%2Bat%2B1.18.00%2BAM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gcS7Gu1K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558079212528_Screenshot%2B2019-05-17%2Bat%2B1.18.00%2BAM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will take you to the Google Cloud Platform Service Accounts page, but you first need to update the Service Account's role.&lt;/p&gt;

&lt;p&gt;Once the page finishes loading:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the menu button in the upper left-hand corner and click on &lt;strong&gt;IAM &amp;amp; admin&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Service Accounts&lt;/strong&gt; in the left-hand menu.&lt;/li&gt;
&lt;li&gt;Click on the &lt;strong&gt;Create Service Account&lt;/strong&gt; button at the top of the page.&lt;/li&gt;
&lt;li&gt;In the next page, enter a name for the service account and then click on the &lt;strong&gt;CREATE&lt;/strong&gt; button to submit the form.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Role&lt;/strong&gt; and select &lt;strong&gt;Owner&lt;/strong&gt; as the role.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wNtBbuRr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558054021559_Screenshot%2B2019-05-17%2Bat%2B1.45.23%2BAM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wNtBbuRr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558054021559_Screenshot%2B2019-05-17%2Bat%2B1.45.23%2BAM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then click on the &lt;strong&gt;CONTINUE&lt;/strong&gt; Button.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the &lt;strong&gt;+ CREATE KEY&lt;/strong&gt; button. Click the &lt;strong&gt;CREATE&lt;/strong&gt; to download your service key.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A download of the JSON file will start. Copy the download file to the &lt;code&gt;server&lt;/code&gt; directory of the project.&lt;/p&gt;

&lt;p&gt;Then update the &lt;code&gt;.env&lt;/code&gt; file to reflect the name of the JSON file you just downloaded:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
    GOOGLE_APPLICATION_CREDENTIALS=&amp;lt;GOOGLE SERVICE FILE&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Prepare Your FAQ Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is where we prepare our frequently asked questions. Create a new file in any location on your system as &lt;code&gt;faq.csv&lt;/code&gt;. Then, copy the below FAQ samples to it and save.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How can I place orders?, "There are two ways to place orders for our services:"
What does an order cost?, "The costs are calculated according to the amount of time involved and the quality requirements. These vary from project to project. Therefore, per project, you will receive an individual offer on demand."
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above is just an example for our testing. Feel free to replace with yours. The first column is the question, while the second column is the answer. The data are comma-separated and no empty rows are expected, else, you will get an error.&lt;/p&gt;

&lt;p&gt;Here is a simple example of the format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    An example question 1, An answer 1
    An example auestion 2, An answer 2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;From the data on the &lt;code&gt;faq.csv&lt;/code&gt; file, when a user sends in a query as - “&lt;strong&gt;How can I place orders?&lt;/strong&gt;”. The expected output from Dialogflow will be - “&lt;strong&gt;here are two ways to place orders for our services:&lt;/strong&gt;” and so on.&lt;/p&gt;

&lt;p&gt;Next, go back to your Dialogflow dashboard, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the &lt;strong&gt;Knowledge&lt;/strong&gt; tab on the left the page&lt;/li&gt;
&lt;li&gt;Click on the &lt;strong&gt;CREATE KNOWLEDGE BASE&lt;/strong&gt; button&lt;/li&gt;
&lt;li&gt;Type in &lt;strong&gt;FAQ&lt;/strong&gt; as the name of the knowledge&lt;/li&gt;
&lt;li&gt;Click on the &lt;strong&gt;Create the first one&lt;/strong&gt; link&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qWSsNAw9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558055148291_Screenshot%2B2019-05-17%2Bat%2B2.03.54%2BAM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qWSsNAw9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558055148291_Screenshot%2B2019-05-17%2Bat%2B2.03.54%2BAM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the popup that appears, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enter the &lt;strong&gt;Document Name&lt;/strong&gt; as “FAQ” &lt;/li&gt;
&lt;li&gt;Choose “FAQ" as the &lt;strong&gt;knowledge type&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;txt/csv&lt;/code&gt; as the &lt;strong&gt;Mime Type&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Upload file from your computer&lt;/strong&gt; as the &lt;strong&gt;DATA SOURCE&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on the &lt;strong&gt;SELECT FILE&lt;/strong&gt; button and browse through to the CSV file you created above and upload it&lt;/li&gt;
&lt;li&gt;Then, click the &lt;strong&gt;CREATE&lt;/strong&gt; button&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;ADD RESPONSE&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Finally, click the &lt;strong&gt;SAVE&lt;/strong&gt; button to register your changes&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Building the App Interface
&lt;/h2&gt;

&lt;p&gt;Now that we have both our client and server apps running, the next thing we’ll do is to create a simple chat interface so we can integrate Dialogflow. &lt;/p&gt;

&lt;p&gt;Vue enables us to build reusable components which make up our app user interface. We’ll split the app UI into smaller components so we can build them separately:&lt;/p&gt;

&lt;p&gt;For brevity’s sake, we’ll divide the app into two components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Messages.vue&lt;/code&gt; *&lt;strong&gt;&lt;em&gt;- *&lt;/em&gt;&lt;/strong&gt;for listing messages and a form input&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Login.vue&lt;/code&gt; - displays the login form&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create the &lt;code&gt;Messages.vue&lt;/code&gt; and &lt;code&gt;Login.vue&lt;/code&gt; files inside the &lt;code&gt;src/components&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;To keep the component file as minimal as possible, I have added all the CSS of the components to a single CSS file. Create the CSS file as  &lt;code&gt;App.css&lt;/code&gt; in the &lt;code&gt;src&lt;/code&gt; directory of the project and then add the below styles to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    /* ./App.css */

    html,body{
        width: 100%;
        height: 99vh;
        overflow: hidden;
    }
    #app {
        font-family: 'Avenir', Helvetica, Arial, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-align: center;
        color: #2c3e50;
    }
    .login-container {
        display: grid; 
        grid-template-rows: 4fr 1fr;
        max-height: 320px;
        min-height: 320px;
    }
    input[type="text"] {
        padding: 10px 8px;
        margin-top: 10px;
        border-radius: 2px;
        border: 1px solid darkgray;
        font-size: 16px;
        box-sizing: border-box;
        display: block;
    }
    .inputs {
        text-align: center;
        align-self: center;
        justify-self: center;
    }
    .submit {
        margin-top: 9px;
        padding: 20px;
        background: rgb(99, 99, 212);
        color: white;
        font-size: 16px;
    }
    .chat-message {
        width: 70%;
        margin-top: 4px;
        padding: 4px;
        text-align: left;
        word-wrap: break-word;
        margin: 5px;
    }
    .from-admin {
        background: rgb(150, 178, 183);
        color: rgb(39, 37, 37);
        float: left;
    }
    .from-client {
        background: rgb(48, 13, 79);
        color: white;
        float: right;
    }
    .input-container {
        margin: 0px;
    }
    .chat-input {
        width: 99%; 
        margin-bottom: 0px;
    }
    .client-messages {
        overflow-y: scroll; 
        height: 320px;
    }
    .chat-container {
        position: fixed; 
        right: 0px; 
        bottom: 0px; 
        width: 400px; 
        z-index: 100000; 
        box-sizing: border-box;
    }
    .head {
        padding: 9px; 
        display: grid; 
        background-color: rgb(48, 13, 79); 
        color: white; 
        border-top-left-radius: 5px; 
        border-top-right-radius: 5px;
    }
    .chat-box {
        border-left: 1px solid rgb(48, 13, 79);
        border-right: 1px solid rgb(48, 13, 79);
        background: lightgray;
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Login Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We’ll be using the &lt;a href="https://vuejs.org/v2/guide/single-file-components.html"&gt;Single File Component&lt;/a&gt; structure for our components.&lt;/p&gt;

&lt;p&gt;Add the mark-up for the Login component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;!-- ./src/components/Login.vue --&amp;gt;

    &amp;lt;template&amp;gt;
        &amp;lt;div class="login-container chat-box"&amp;gt;
            &amp;lt;div class="inputs"&amp;gt;
                &amp;lt;input type="text" placeholder="your username" v-model="username"&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;button type="submit" class="submit" v-on:click="login"&amp;gt; Submit &amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the preceding code, we added an input form that captures the user username. Also, we added a click event that calls the &lt;code&gt;login&lt;/code&gt; function when the form is submitted.&lt;/p&gt;

&lt;p&gt;Next, add the script section for the Login component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;!-- ./src/components/Login.vue --&amp;gt;

    &amp;lt;script&amp;gt;
    export default {
        data: function () {
            return {
                username: "",
            }
        },
        methods: {
            login() {
                this.$emit("authenticated", this.username);
            }
        }
    }
    &amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here, we defined the login function that will be called on the mark-up file. In the function, we emit a custom event named &lt;code&gt;authenticated&lt;/code&gt; to the parent component passing the username along.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Messages Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Define the messages component that lists messages and holds the form input for adding new messages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;!-- ./src/components/Messages.vue --&amp;gt;

    &amp;lt;template&amp;gt; 
        &amp;lt;div class="chat-box"&amp;gt;
            &amp;lt;div class="client-messages "&amp;gt;
                &amp;lt;div
                    class="chat-message" 
                    v-for="message in messages" 
                    v-bind:key="message.id"
                    v-bind:class="[(message.user.id == userId) ? 'from-client' : 'from-admin']"
                &amp;gt;
                    {{ message.text }}
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="input-container"&amp;gt;
                &amp;lt;input
                    class="chat-input" 
                    type="text" 
                    placeholder="enter message..." 
                    v-model="message"
                    v-on:keyup.enter="addMessage"
                &amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then add the script section for the messages component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;!-- ./src/components/Messages.vue --&amp;gt;

    &amp;lt;script&amp;gt;
    export default {
        props: ['messages', 'userId'],
        data() {
            return {
                message: ""
            }
        },
        methods: {
            addMessage() {
                this.$emit('new-message', this.message);
                this.message = "";
            }
        }
    }
    &amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;The App Component&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now let’s bring all the other component into a single component to build up the interface. Replace the code in the &lt;code&gt;src/App.vue&lt;/code&gt; file with the below mark-up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;!-- ./src/App.vue --&amp;gt;

    &amp;lt;template&amp;gt;
      &amp;lt;div id="app"&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;img alt="Vue logo" src="./assets/logo.png"&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="chat-container"&amp;gt;
          &amp;lt;div class="head" @click="displayChatArea=!displayChatArea"&amp;gt;
            &amp;lt;div style="justify-self: center;"&amp;gt; FAQx &amp;lt;/div&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div v-if="displayChatArea"&amp;gt;
            &amp;lt;login
              v-if="!authenticated" 
              v-on:authenticated="setAuthenticated" 
            /&amp;gt;
            &amp;lt;messages 
              v-else 
              v-on:new-message="sendMessage"
              :messages="messages"
              :userId="userId"
            /&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then add the script section to the &lt;code&gt;src/App.vue&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;!-- ./src/App.vue --&amp;gt;

    &amp;lt;script&amp;gt;
    import { StreamChat } from 'stream-chat';
    import axios from 'axios';

    import Messages from '@/components/Messages.vue';
    import Login from '@/components/Login.vue';

    import './App.css';

    export default {
      name: 'app',
      components: {
        Messages,
        Login
      },
      data: function () {
        return {
          authenticated: false,
          roomId: "",
          messages: [],
          userId: "",
          displayChatArea: false,
          channel: null,
          token: null,
          client: null
        }
      },
      methods: {
      },
    }
    &amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The Vue app should look like below at this point:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--alOHIOYf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558079976925_Screenshot%2B2019-05-17%2Bat%2B8.58.52%2BAM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--alOHIOYf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558079976925_Screenshot%2B2019-05-17%2Bat%2B8.58.52%2BAM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Chat Work
&lt;/h2&gt;

&lt;p&gt;So far, we have our chat interface ready but we still can’t converse because we are yet to connect the app to Stream Chat. We’ll be doing so next.&lt;/p&gt;

&lt;p&gt;To start using the SDK, we first need to initialize it. Do so by adding the below function in the &lt;code&gt;methods: {…}&lt;/code&gt;  block in the &lt;code&gt;App.vue&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./src/App.vue

    // [...]
        async initializeClient () {
          // Initialize the StreamChat SDK
          const client = new StreamChat(process.env.VUE_APP_KEY);

          await client.setUser(
            {
              id: this.userId,
              name: this.userId,
            },
            this.token,
          );

          this.client = client
        },
    // [...]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next, add a function for creating a new channel for the user that just logs in to the &lt;code&gt;methods: {…}&lt;/code&gt; block of &lt;code&gt;App.vue&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./src/App.vue

    // [...]
        async initializeChannel () {
          const channel = this.client.channel('commerce', this.userId, {
            name: 'Customer Support',
          });

          this.channel = channel

          // fetch the channel state, subscribe to future updates
          let state = await channel.watch();

          this.messages = state.messages

          // Listen for new messages
          channel.on('message.new', event =&amp;gt; {
            this.messages.push(event.message)
          });
        },
    // [...]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here, we are creating a new channel for every user that logs in so that their messages are sperate from other users. Then we started listening for new messages on that channel using - &lt;code&gt;channel.on('message.new...'&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, add a function for logging the user into the &lt;code&gt;methods: {…}&lt;/code&gt; block of &lt;code&gt;App.vue&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./src/App.vue

    // [...]  
       async setAuthenticated(userId) {
          const response = await axios.post(`${process.env.VUE_APP_SERVER}/login`, {userId})

          if (response.data.status === 'success') {
            this.authenticated = true
            this.token = response.data.token
            this.userId = userId

            await this.initializeClient()

            await this.initializeChannel()
          }
        },
    // [...] 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the proceeding code, we make a post request to the &lt;code&gt;/login&lt;/code&gt; endpoint on the server to generate a token for the user. The token is required for initializing the StreamChat SDK.&lt;/p&gt;

&lt;p&gt;Finally, add a function for sending messages into the &lt;code&gt;methods: {…}&lt;/code&gt; block of &lt;code&gt;App.vue&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./src/App.vue

    // [...] 
       async sendMessage (message) {
          this.channel &amp;amp;&amp;amp; await this.channel.sendMessage({
            text: message
          });
        },
    // [...]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When the user submits the message form, we’ll call this function to send a message to the channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up the Webhook
&lt;/h2&gt;

&lt;p&gt;For now, we can send a message from to channels but we don’t get a reply because there is no one on the other end to reply. We’ll now employ the service of a chatbot to reply to those messages.&lt;/p&gt;

&lt;p&gt;Next, create a function to query Dialogflow for an answer to a given input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./server/app.js

    // [...]
    async function getAnswer (question) {
        const sessionId = uuid.v4();

        // Create a new session
        const sessionClient = new dialogflow.SessionsClient();
        const sessionPath = sessionClient.sessionPath(
            process.env.DIALOGFLOW_PROJECT_ID, 
            sessionId
        );

        // The text query request.
        const request = {
          session: sessionPath,
          queryInput: {
            text: {
              // The query to send to the dialogflow agent
              text: question,
              // The language used by the client (en-US)
              languageCode: 'en-US',
            },
          },
        };

        // Send request and log result
        const responses = await sessionClient.detectIntent(request);

        return responses[0].queryResult.fulfillmentText;
    }
    // [...]

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;By using &lt;a href="https://getstream.io/chat/docs/#webhooks"&gt;webhooks&lt;/a&gt;, you can receive all events within your application. When configured, every event happening on Stream Chat will propagate to your webhook endpoint via an HTTP POST request. For our use-case, we are most interested in the &lt;code&gt;"message.new"&lt;/code&gt; event.&lt;/p&gt;

&lt;p&gt;Next, create an endpoint for our &lt;a href="https://getstream.io/chat/docs/#webhooks"&gt;webhook&lt;/a&gt;. Stream will make a request to this endpoint for every new message sent to the channel.&lt;/p&gt;

&lt;p&gt;Add the below code to the &lt;code&gt;server/app.js&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // ./server/app.js

    // [...]
    app.post('/webhook', async (req, res) =&amp;gt; {
        // extract data from the POST payload
        const { cid, type, message, user } = req.body
       // Get the organization and channel from the cid param
        const [org, chan] = cid.split(':')

        res.status(200).send({
            status: "success"
        })

        // Make sure the new message is not comming form the bot
        // We are using 'bandit' as a username for our bot
        if (type === "message.new" &amp;amp;&amp;amp; user.id !== 'bendit') {
            const channel = serverSideClient.channel(org, chan);

            const messagePayload = {
                text: await getAnswer(message.text),
                user: {id: 'bendit'},
            }

            try {
                await channel.sendMessage(messagePayload);
            } catch(e) {
                console.log(e.message)
            }
        }
    });
    // [...]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the proceeding code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After extracting the data from the POST request, we check the type of the event if it’s a "&lt;strong&gt;message.new&lt;/strong&gt;" event.  Also, we want to make sure that the message is not coming from the bot - 'bendit'. ‘bandit’ is just a generic username we want to use as our bot. It can be any name you like.&lt;/li&gt;
&lt;li&gt;Next, we call the getAnswer function to query Dialogflow for an answer to the new message that just came in.&lt;/li&gt;
&lt;li&gt;Then finally, we call the &lt;code&gt;channel.sendMessage(…&lt;/code&gt; function to send the result from Dialogflow to the channel so that the user can see the reply.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Enable the Webhook&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Although we now have our webhook ready which can be accessed from &lt;a href="http://localhost:3000/webhook"&gt;http://localhost:3000/webhook&lt;/a&gt;. It is only accessible from your local system. We need to expose the URL so it can be accessible by Stream which we can do using ngrok.&lt;/p&gt;

&lt;p&gt;Open up ngrok and expose the URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ./ngrok http 3000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SphGyRGG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F0CE8A6AF29682CF11AEC325A5576A989C8113A90BEDEF3E681135BEE78087B8_1557343069346_image_preview9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SphGyRGG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_F0CE8A6AF29682CF11AEC325A5576A989C8113A90BEDEF3E681135BEE78087B8_1557343069346_image_preview9.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now note any of the Forwarding URLs which can now be accessed from anywhere.&lt;/p&gt;

&lt;p&gt;Head to your Stream &lt;a href="https://getstream.io/dashboard"&gt;Dashboard&lt;/a&gt; and enable the webhook option:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scroll down to the &lt;strong&gt;Chat Event&lt;/strong&gt; section&lt;/li&gt;
&lt;li&gt;Enable the webhook by selecting the &lt;strong&gt;Active&lt;/strong&gt; selection&lt;/li&gt;
&lt;li&gt;Enter the ngrok generated URL in the &lt;strong&gt;URL&lt;/strong&gt; input form&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Save&lt;/strong&gt; button to save your changes
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9KDFjkHS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paper-attachments.dropbox.com/s_BC3401DD7DD2340BE6F9C669BE5C841F9F4C705937943E31239A7EE029F285F1_1558049319059_Screenshot%2B2019-05-17%2Bat%2B12.26.40%2BAM.png" alt="Enabling webhook"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing Chat
&lt;/h2&gt;

&lt;p&gt;Good job! you have successfully built a FAQ bot. Now let’s test the app to see that it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restart the Node server terminal&lt;/li&gt;
&lt;li&gt;Open the Vue app on your browser &lt;/li&gt;
&lt;li&gt;Now, ask a user for a given question and see the response from the bot&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;In this tutorial, you have successfully built a FAQ bot . We explored a way in which you can add bots to your Stream app using the webhook feature provided by the Stream Chat infrastructure.&lt;/p&gt;

&lt;p&gt;The sky is the limit for what you can build from here. What we've built is just a tip of the iceberg in terms of what you can do with bots. You can extend the functionality of the bot by adding more &lt;a href="https://dialogflow.com/docs/intents"&gt;intents&lt;/a&gt; with &lt;a href="https://dialogflow.com/"&gt;Dialogflow&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can find the complete code of this tutorial on &lt;a href="https://github.com/dongido001/getstream-chat-dialogflow-faq-bot.git"&gt;GitHub&lt;/a&gt;. For more information on Stream Chat, have a look &lt;a href="https://getstream.io/chat/"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>chatbots</category>
      <category>dialogflow</category>
      <category>stream</category>
      <category>vue</category>
    </item>
  </channel>
</rss>
