<?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: Dasha</title>
    <description>The latest articles on DEV Community by Dasha (@dashaai).</description>
    <link>https://dev.to/dashaai</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%2F667076%2F4f76a337-2964-4034-b168-4139f7f117d5.jpg</url>
      <title>DEV Community: Dasha</title>
      <link>https://dev.to/dashaai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dashaai"/>
    <language>en</language>
    <item>
      <title>Call center automation: how I created a conversational AI app version of my own Apple customer support call in just 2 hours.</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Wed, 27 Oct 2021 15:25:28 +0000</pubDate>
      <link>https://dev.to/dashaai/call-center-automation-how-i-created-a-conversational-ai-app-version-of-my-own-apple-customer-support-call-in-just-2-hours-3a4h</link>
      <guid>https://dev.to/dashaai/call-center-automation-how-i-created-a-conversational-ai-app-version-of-my-own-apple-customer-support-call-in-just-2-hours-3a4h</guid>
      <description>&lt;p&gt;This post is a bit different from what I’ve created before. This time, I’ve recreated an Apple Support operator-to-customer phone call in a form of an automated conversational AI app. &lt;/p&gt;

&lt;p&gt;Let me give you the reason why I’ve decided to create this Apple customer support conversational AI app. My conversational with the human operator took about 7 minutes in total. That’s 7 minutes of someone’s time to answer 2 questions and 7 minutes of my time to ask them. I believe that artificial intelligence can be used to automate this type of customer support conversation, therefore saving operators time to focus on the most complex issues that require human creativity.&lt;/p&gt;

&lt;p&gt;Take a look at the demo call to have a quick look at how the app works:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/5S9OMcbSSuo"&gt;https://youtu.be/5S9OMcbSSuo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This app can serve you as a base to create your own customer support conversational AI apps and use it for call center automation.&lt;/p&gt;

&lt;p&gt;Here are the steps we will take to create this app: &lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started with Dasha conversational AI
&lt;/h2&gt;

&lt;p&gt;If you have never used Dasha before, you need to activate your API key. The API key lets you load your conversational application to the Dasha Cloud Platform, where it is executed. If you have your Dasha API key, ignore this part.  &lt;/p&gt;

&lt;p&gt;Download the latest versions of Microsoft VSCode, Node.js and NPM installed. Dasha Studio is implemented as an extension to VSCode for your convenience. Open Visual Studio Code and install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=dasha-ai.dashastudio"&gt;Dasha Studio extension&lt;/a&gt; and Dasha Command Line Interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; dasha-ai.dashastudio &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; 
npm i &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="s2"&gt;"@dasha.ai/cli@latest"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, run a command to register your Dasha API key. A browser window will pop up and you will need to sign up for an account.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dasha account login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterwards, run to check your API key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dasha account info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let’s get to know the files you’ll be using to create your conversational AI app. We recommend downloading &lt;a href="https://github.com/dasha-samples/blank-slate-app"&gt;Dasha Blank Slate app&lt;/a&gt; source code and use it as a base to write your code. &lt;/p&gt;

&lt;p&gt;For that, you’ll have to open &lt;strong&gt;main.dsl&lt;/strong&gt; and &lt;strong&gt;data.json&lt;/strong&gt; files and delete everything you see there. This way, you’ll be able to start writing your code from scratch while having all the other essential files (for instance, the &lt;code&gt;commonReactions&lt;/code&gt; library that has pre-programmed replies so you don’t have to worry about coding those).&lt;/p&gt;

&lt;p&gt;You can also download the source code of this conversational AI app &lt;a href="https://github.com/dasha-samples/apple-customer-support-app"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You’ll mainly be using 2 files to create your conversational AI app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;main.dsl -- this is where you’ll write your DashaScript Language code to create the workflow of your conversational AI app. With Dasha Studio extension on and with the directions in this post, it’ll be an easy job for you. You can read more about it in our &lt;a href="http://docs.dasha.AI"&gt;documentation&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;data.json -- is the data set you provide to train the Dasha Cloud neural networks to recognize user &lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;intents&lt;/a&gt; and identify &lt;a href="https://dasha.ai/en-us/blog/named-entity-recognition"&gt;named entities&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, you will want to use the index.js file to write out external functions. External functions are needed to process data with the SDK. For example, you may need to process data, get access to databases or APIs or use it for any other purposes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;index.js --  is the server-side JavaScript file to which the Dasha SDK is imported and which launches the contents of the &lt;strong&gt;/app&lt;/strong&gt; folder to the Dasha Cloud to be executed.  Here you’ll be adding any external functions you deem necessary once adapting the code to your company’s needs. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Familiarizing yourself with the files is important, but now let’s get to the fun part - programming the recreated Apple customer support conversational AI app!&lt;/p&gt;

&lt;h2&gt;
  
  
  Purpose of the conversation
&lt;/h2&gt;

&lt;p&gt;The conversation I had with the call center representative was quite short, though informative. My purpose was to ask 2 main questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What can I do to get my mom’s iPhone broken screen fixed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How can I trade in my own phone and get a discount for a newer model.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Throughout the code you’ll see what kind of questions I asked and the way they were answered. &lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the basics
&lt;/h2&gt;

&lt;p&gt;First of all, download the &lt;a href="https://github.com/dasha-samples/apple-customer-support-app"&gt;source code of this conversational AI app&lt;/a&gt; to be a form of a guide to you.&lt;/p&gt;

&lt;p&gt;Now, the basics here are 2 things: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;importing common library
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "commonReactions/all.dsl";```



* writing our the context for the app



```dsl
context 
{
    // declare input variables phone and name  - these variables are passed at the outset of the conversation. In this case, the phone number and customer’s name 
    input phone: string;

    // declare storage variables 
    output first_name: string = "";
    output last_name: string = "";
    output phone_model: string = "";
    output owner_phone_model: string = "";

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next step is writing your first node called root. Take a look at how it’s written out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;start node root 
{
    do 
    {
        #connectSafe($phone);
        #waitForSpeech(1000);
        #sayText("Hi, thanks for calling Apple Support. My name is Dasha. Can I get your name, please?");
        wait *;
    }   
    transitions 
    {

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’re achieving multiple things here. In the &lt;code&gt;do&lt;/code&gt; section we establish a connection to the user’s phone, wait for 1 second to speak (or give the user 1 second to say something), and then say our welcome message. &lt;/p&gt;

&lt;p&gt;Since we need to know the user’s name, we should write where the conversation should go after we get that information in the &lt;code&gt;transitions&lt;/code&gt; section. We make a transition to the node that follows once a particular intent gets triggered (&lt;code&gt;#messageHasData("first_name");&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Let’s take a dive into the data.json file and take a look at how entities work there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"entities"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"first_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"open_set"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"values"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
      &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bridgette"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"James"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Sarah"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Jermaine"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Roseanne"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Ahmed"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Tony"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Jon"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
      &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"(Oscar)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"(Danielle)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My name is (Sophie)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My name is (Sarah)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My name is (Cameron)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My name is (Steven)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My name is (Jessica)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My name is (Jon)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My name is (Ahmed)[first_name]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"My first name is (Lisa)[first_name]"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;includes&lt;/code&gt; section is very helpful. It provides you with an opportunity to have your model trained better as you feed it more examples. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Onexit&lt;/code&gt;section lets the conversational AI app store, remember, and later use the variables we feed it. In this case, we assume the user might say their last name, first name, or both. And we got to store that information for later use. Note that this information will be used in the node you specify right after &lt;code&gt;onexit&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Moving on to the next nodes. &lt;/p&gt;

&lt;p&gt;In the following digression, our purpose is to program the conversational AI app to ask the user about their concern or problem and then transition to the corresponding nodes (or digressions).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression how_may_i_help
{
    conditions {on #messageHasData("first_name");} 
    do 
    {
        set $first_name =  #messageGetData("first_name")[0]?.value??"";
        set $last_name =  #messageGetData("last_name")[0]?.value??"";
        #sayText("Hi," + $first_name + " how may I help you out today?");
        wait *;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that in the &lt;code&gt;onexit&lt;/code&gt; section, what comes after &lt;code&gt;set&lt;/code&gt; goes to our context up above. &lt;/p&gt;

&lt;p&gt;On the phone call, I mentioned my problem: a broken phone screen. But I haven’t mentioned the model of my iPhone. Naturally, the operator asked me that question and our app shall do the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node what_phone_model
{
    do
    {
        #sayText("Could you tell me the model of the phone, please?");
        wait *;
    }   
    transitions
    {

        broken_phone_screen: goto broken_phone_screen on #messageHasData("phone_model");
    }
    onexit
    {
        broken_phone_screen : do {
        set $phone_model =  #messageGetData("phone_model")[0]?.value??"";}
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we need to ask qualifying questions to make the final answer to the first question as accurate as possible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node broken_phone_screen
{
    do 
    {     
        #sayText("Gotcha, we're more than happy to help you with getting the phone screen fixed. I'm gonna need one moment."); 
        // a pause in between sentenses for more human-like interaction
        #waitForSpeech(1000);
        #sayText("Okay," + $phone_model + " , let me see. Alright. Do you know if you've got Apple Care coverage on you?");
        wait*;
    }
    transitions
    {
        no_apple_care_explain: goto no_apple_care_explain on #messageHasIntent("no") or #messageHasIntent("no_apple_care") or #messageHasIntent("how_much_for_repair_with_no_apple_care");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here (in the &lt;code&gt;transitions&lt;/code&gt; section and following nodes) I didn’t program the app to have an answer to a “yes, I do have Apple Care coverage” as I wanted to stick to the original conversation as closely as possible for it to be more realistic.&lt;/p&gt;

&lt;p&gt;We got information that the user has no Care coverage. I’m glad I wasn’t asked to buy Apple Care on the spot.&lt;/p&gt;

&lt;p&gt;Pro note: upselling is nice, but always remember that the rule of the thumb and the main purpose of a conversational AI app is to solve the user’s problem as fast and as efficiently as possible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node no_apple_care_explain
{
    do 
    {
        #sayText("Alright. So, when it comes to getting Apple Care, it can actually only be purchased within 60 days of originally purchasing the device... Other than that once there's actual damage to the phone, you're actually not allowed to purchase Apple care.");
        wait *;
    }   
    transitions 
    {
        confirm_phone_model: goto confirm_phone_model on #messageHasIntent("broken_phone_screen_replace_cost") or #messageHasIntent("how_much_for_repair_with_no_apple_care");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;code&gt;do&lt;/code&gt; section we don’t pose any questions. This means the conversation doesn’t have to necessarily go the direction we program it to go in the &lt;code&gt;transitions&lt;/code&gt; section. It can go to one of the digressions instead, depending on what the user is thinking. &lt;/p&gt;

&lt;p&gt;In my case, I asked the call center operator how much I’d have to pay to repair the phone screen without having Apple Care on me. And that’s what I wrote in the &lt;code&gt;intents&lt;/code&gt; section in the data.json file for that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"v2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"intents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"how_much_for_repair_with_no_apple_care"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"how much does it cost to repair without apple care"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"how much will it cost to repair without apple care"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"how much would it cost to repair without apple care"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"Without apple care how much does it cost "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"what's the price to repair the phone with no apple care"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"what's the price for reparing phone without apple care"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"cost without apple care"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"if I don't have apple care, how much would it cost me to repare"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"without having apple care how much the repair"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"no apple care, how much would it cost to repair the screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"reparing the screen without apple care"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"broken_phone_screen_repair_cost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"how much does it cost to repair a broken screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"how much does it cost to repair a cracked screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"how much would it cost to repair a cracked phone screen?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"what's the price to repair a cracked screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"what's the price to repair the broken screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"how much does it cost to fix a broken phone screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"cost of broken phone screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"price to fix a cracked screen on the phone"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under &lt;code&gt;includes&lt;/code&gt; you write words or phrases that you know your user would say in a particular instant. There can be as many variations as you like.&lt;/p&gt;

&lt;p&gt;Next node is all about confirming the phone model the user has already mentioned before. It’s only natural for a human to ask such a confirmation question and by the same token makes the conversational AI sound more natural. And that’s besides providing feedback to the user that we got all the information right.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node confirm_phone_model
{
    do 
    {     
        #sayText("Yes, I'm pulling that up now..."); 
        #waitForSpeech(1000);
        #sayText(" " + $phone_model + " Is it Pro or Pro Max, you said?");
        wait*;
    }
    transitions
    {
        screen_repair_price: goto screen_repair_price on #messageHasIntent("no") or #messageHasData("phone_model") or #messageHasIntent("not_pro_pro_max") or #messageHasIntent("phone_just_as_i_said");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next up I have 2 identical phrases mapped in 2 different ways: digression and node.&lt;/p&gt;

&lt;p&gt;Nodes are stable. They let the conversation move from one point to another in a linear way. Digressions, on the other hand, are like conversational zigzags, the conversation could jump from one digression to another and then back (if needed).&lt;/p&gt;

&lt;p&gt;In this particular case, I wrote both because I used the following node in my previous node’s transitions section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node screen_repair_price
{
    do 
    {     
        #sayText("Okay gotcha, so that pricing is showing one ninety-nine and that of course plus tax most likely."); 
        wait*;
    }
    transitions
    {

    }
}

digression screen_repair_price
{
    conditions {on #messageHasIntent("pnot_pro_pro_max") or #messageHasIntent("phone_just_as_i_said") and #messageHasData("phone_model");} 
    do 
    {     
        #sayText("Okay gotcha, so that pricing is showing one ninety-nine and that of course plus tax most likely."); 
        wait*;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;transitions&lt;/code&gt; here are empty. That means the conversation can go to one of the digressions based on the intents triggered.&lt;/p&gt;

&lt;p&gt;Here’s a very simple digression that a customer support representative provides the user with the information on the timing of the repair.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression time_no_parts_available
{
    conditions {on #messageHasIntent("time_no_parts_available");} 
    do 
    {     
        #sayText("It depends, but the average time is about three to five business days. And that's for mailing in the phone instead of going to the store. That being said, I've never heard of the screen repair taking longer than this time frame."); 
        wait*;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And yet another simple digression that will get triggered shall a user ask what the mailing/shipping options are.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression mailing_option_pricing
{
    conditions {on #messageHasIntent("mailing_option") or #messageHasIntent("mailing_option_pricing");} 
    do 
    {     
        #sayText("Alright, so with shipping, we only ship with UPS or FedEx. That typically costs about 5 to 6 dollars. Could be a bit more expensive, though."); 
        wait*;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my real-life conversation with the Apple support representative, I got all the information I required. So it was time for me to move on to my next question about trading in my phone to get a newer version. &lt;/p&gt;

&lt;p&gt;Note that it’s a digression since the question I asked popped out of the blue.&lt;/p&gt;

&lt;p&gt;This digression structure follows the same logic as the digressions above, so should be easy breezy for you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression trade_in_update
{
    conditions {on #messageHasIntent("upgrade_phone") or #messageHasIntent("trade_in_phone");} 
    do
    {
        #sayText("Could you tell me the model of the phone, please?");
        wait *;
    }   
    transitions
    {
        trade_in_cost: goto trade_in_cost on #messageHasData("phone_model");
    }
    onexit
    {
        trade_in_cost : do {
        set $owner_phone_model =  #messageGetData("phone_model")[0]?.value??"";}
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next up is a very simple node that we program to let the user know how much money that would have as a trade-in credit for the purchase of the new iPhone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node trade_in_cost
{
    do 
    {   
        #sayText("So with the " + $owner_phone_model + " in prestine condition you can get up to 500 dollars in trade-in credit. That's for the next generation phone."); 
        wait*;
    }
    transitions
    {

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly, here we let the user know how much the final cost of the phone be after the credits are applied:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression new_phone_price_after_discound
{
    conditions {on #messageHasIntent("new_phone_price_after_discount");} 
    do 
    {     
        #sayText("The best thing to do is to go to apple dot com because there are different variations to the phone. But the bottom level model with no Apple Care is showing to be 599 dollars after trade it for 128 gigabyte phone. This is a subtotal without tax."); 
        wait*;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point I got both of my questions answered and my conversation with the Apple Support operator ended.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression thats_it_bye
{
    conditions {on #messageHasIntent("thank_you") or #messageHasIntent("that_would_be_it");} 
    do 
    {     
        #sayText("No problem, happy to help. I hope you have a great rest of your day. Bye!"); 
        #disconnect();
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that’s it. End of the conversation with all issues tackled the easiest way possible.&lt;/p&gt;

&lt;p&gt;Despite this being my whole conversation, I’ve written out more digressions that solve some of the most common user’s problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frozen screen&lt;/li&gt;
&lt;li&gt;Phone doesn’t get charged&lt;/li&gt;
&lt;li&gt;Accidental purchase on Apple Store, iTunes, etc&lt;/li&gt;
&lt;li&gt;User forgot their iPhone password&lt;/li&gt;
&lt;li&gt;iPhone got water damage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the Apple website, all the abovementioned solutions don’t provide an immediate answer. Instead, the users are prompted to contact chat- or voice-based support. These use cases and so many more can be automated by creating one simple conversational AI app that will tackle all the FAQs in the operator’s stead, saving the company money and time of the operators.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final note
&lt;/h2&gt;

&lt;p&gt;Naturally, this is just a demo and is a mirror-like reflection of my own conversation with the Apple Support operator. However, the good news is that this could serve as a solid base for your own customer support conversational AI apps. Or for automating your call center, for example. &lt;/p&gt;

&lt;p&gt;The best thing to do now (and a great opportunity to learn by practicing) is opening the &lt;a href="https://github.com/dasha-samples/apple-customer-support-app"&gt;source code&lt;/a&gt; and adjusting it to make it fit your criteria. &lt;/p&gt;

&lt;p&gt;And the number one best thing to do is to join &lt;a href="https://community.dasha.ai"&gt;Dasha Developer Community&lt;/a&gt; where you’ll meet welcoming like-minded developers who share ideas, questions, and get all the help they need (for free, of course). &lt;/p&gt;

&lt;p&gt;I’m looking forward to seeing your success story in Dasha Developer Community! :) See you there soon! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>vscode</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is Dasha AI?</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Wed, 13 Oct 2021 19:31:10 +0000</pubDate>
      <link>https://dev.to/dashaai/what-is-dasha-ai-1074</link>
      <guid>https://dev.to/dashaai/what-is-dasha-ai-1074</guid>
      <description>&lt;p&gt;You’ve probably heard the terms “conversational AI” and “chatbot” being thrown around. Nowadays, it seems like everyone is getting into the chatbot game, but what is Dasha AI? What does it mean to be a conversational-AI-as-a-service?&lt;/p&gt;

&lt;p&gt;In this article, I’ll explain all of this and more. I’ll also describe the Dasha AI Platform, how it operates, and give you a few examples of what you can do with Dasha.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Dasha AI?
&lt;/h2&gt;

&lt;p&gt;Dasha is a conversational-AI-as-a-service platform that lets you embed realistic voice and text conversational capabilities into your apps or products. By creating a simple conversational AI app, you can create a conversational experience that is natural, intuitive, and engaging. Just like a human, Dasha can hold a conversation with you, ask questions, and help you and/or your company complete tasks that can be and should be automated.&lt;br&gt;
To sound indistinguishable from a human, Dasha uses a set of machine learning (ML), natural language processing (NLP), text-to-speech (TTS), speech-to-text (STT).&lt;/p&gt;

&lt;h2&gt;
  
  
  What can you build with Dasha?
&lt;/h2&gt;

&lt;p&gt;You could start off by building a simple insurance customer service app: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=46nyWBTSHgs"&gt;Embedded content: &lt;/a&gt;&lt;a href="https://www.youtube.com/watch?v=46nyWBTSHgs"&gt;https://www.youtube.com/watch?v=46nyWBTSHgs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or an automated receptionist for a hotel front desk: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=2Glp_HC-VHc&amp;amp;t=29s"&gt;Embedded content: &lt;/a&gt;&lt;a href="https://www.youtube.com/watch?v=2Glp_HC-VHc&amp;amp;t=29s"&gt;https://www.youtube.com/watch?v=2Glp_HC-VHc&amp;amp;t=29s&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OR you can integrate Dasha with an incident management platform to be able to resolve incidents on the go: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=TeJAFI993_0"&gt;Embedded content: &lt;/a&gt;&lt;a href="https://www.youtube.com/watch?v=TeJAFI993_0"&gt;https://www.youtube.com/watch?v=TeJAFI993_0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or build an app to qualify inbound leads and integrate it with Hubspot: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/MjKQ2Zibqgk"&gt;Embedded content: &lt;/a&gt;&lt;a href="https://youtu.be/MjKQ2Zibqgk"&gt;https://youtu.be/MjKQ2Zibqgk&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Dasha works
&lt;/h2&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/1RFIvUhIVcMwMbl99JZbMe/960dbf26ba7b9c859ad3dc1d3b5386ca/How_Dasha_works.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/1RFIvUhIVcMwMbl99JZbMe/960dbf26ba7b9c859ad3dc1d3b5386ca/How_Dasha_works.png" alt="How Dasha works"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture overview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/RX25GQa5pxoiwjAZnG4J7/adc2dbeb223bdf8d2466ca67d8e9fe3a/Architecture_Overview.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/RX25GQa5pxoiwjAZnG4J7/adc2dbeb223bdf8d2466ca67d8e9fe3a/Architecture_Overview.png" alt="Architecture Overview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dasha platform consists of 3 main parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dasha Cloud&lt;/li&gt;
&lt;li&gt;Dasha SDK&lt;/li&gt;
&lt;li&gt;Dasha Studio&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dasha SDK
&lt;/h3&gt;

&lt;p&gt;The Dasha SDK (software development kit) is an abstraction layer that lets you connect your locally stored conversational application to the Dasha AI as a service cloud platform where it is executed. It hides (abstracts) communication channels from you and, like other libraries, gives you a programmable Node.js interface that you can use every day.&lt;br&gt;
We regularly update Dasha SDK so that the users have the best experience possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dasha Cloud
&lt;/h3&gt;

&lt;p&gt;Dasha Cloud provides conversational AI as a service. This means that you don’t need to be a data scientist to use machine learning when building Dasha conversational apps. For example with Dasha Cloud, your app uses an NLU based on neural networks that are trained with the data you provide, Speech To Text, Voice Activity Detectors, and many other things. &lt;br&gt;
Here is a &lt;a href="https://dasha.ai/en-us/blog/dasha-conversational-ai-as-a-service"&gt;detailed overview&lt;/a&gt; of these cloud AI services. &lt;br&gt;
We use GRPC for communication between SDK and the Dasha Cloud. Here are its advantages: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can connect to Dasha from anywhere, from your PC, from a test environment, from another cloud.&lt;/li&gt;
&lt;li&gt;You do not need to have the public IP address, DNS name, TLS Certificate, because the connection is initiated from your side. Dasha has DNS names, TLS Certificates.&lt;/li&gt;
&lt;li&gt;It's easier to implement A/B testing and scaling of your application. &lt;/li&gt;
&lt;li&gt;It's secure. You do not need to expose any HTTPS endpoints to the world.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dasha Studio
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=dasha-ai.dashastudio"&gt;Dasha Studio&lt;/a&gt; is a &lt;a href="https://code.visualstudio.com/"&gt;Visual Studio Code&lt;/a&gt; extension. It lets you build, train manage and deploy &lt;a href="https://github.com/dasha-samples"&gt;Dasha applications&lt;/a&gt;. Dasha apps are  human-like voice interfaces for CX, support, sales,notifications, smart IVRs or voice interfaces for web and mobile applications and games.You can also add conversational capabilities to websites, games, mobile apps, voice assistants, smart devices, and more with only a few lines of code, from Visual Studio Code.&lt;br&gt;
Since Dasha is an open technology you can write Dasha apps without using Dasha Studio but you will lose out on the syntax highlighting, visual graph editor and debugging tools. All code you write resides on your machine and is your intellectual property.&lt;br&gt;
The language you'll be using to write your conversational AI apps is DashaScript which is the native language of the Dasha Cloud Platform. &lt;/p&gt;

&lt;h2&gt;
  
  
  DashaScript
&lt;/h2&gt;

&lt;p&gt;DashaScript is an event-driven declarative programming language used to design complex real-world conversations that pass a limited Turing test. Automate call center conversations, recreate the Google Duplex demo in under 400 lines of code or create a no-code GUI for your users that translates into DashaScript code.&lt;br&gt;
DashaScript program consists of nodes representing AI actions and transitions between nodes representing conversation events. The program written in DashaScript is called a script. The script is an integral part of your dashaapp that determines its behavior at runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Files that comprise your Dasha conversational AI app
&lt;/h2&gt;

&lt;p&gt;Take any &lt;a href="https://github.com/dasha-samples"&gt;Dasha app&lt;/a&gt;. You will see the &lt;code&gt;/app&lt;/code&gt; folder - this is where your Dasha application resides. &lt;br&gt;
In building Dasha apps in VSCode, you will mainly work with three files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;main.dsl is the Dasha Scripting Language file. DSL is a domain-specific language, derived from TypeScript and used for the exclusive purpose of describing a conversation. You can read more about it in our documentation.&lt;/li&gt;
&lt;li&gt;data.json is the data set you provide to train the Dasha Cloud neural networks to recognize user intents and identify named entities. I'll discuss them in detail right below.&lt;/li&gt;
&lt;li&gt;index.js is the server-side JavaScript file to which the Dasha SDK is imported and which launches the contents of the /app folder to the Dasha Cloud to be executed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Join Dasha Developer Community and check Dasha out for yourself
&lt;/h2&gt;

&lt;p&gt;Join us in the &lt;a href="https://community.dasha.ai"&gt;Dasha developer community&lt;/a&gt; for guidance on your exciting journey of conversational AI app creation. We share thoughts, ideas, problems, and solutions here. See what you can create!&lt;/p&gt;

&lt;p&gt;Godspeed! :)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>beginners</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to integrate Hubspot with Dasha AI using Zapier to automatically qualify leads over the phone</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Mon, 11 Oct 2021 13:37:21 +0000</pubDate>
      <link>https://dev.to/dashaai/how-to-integrate-hubspot-with-dasha-ai-using-zapier-to-automatically-qualify-leads-over-the-phone-4agn</link>
      <guid>https://dev.to/dashaai/how-to-integrate-hubspot-with-dasha-ai-using-zapier-to-automatically-qualify-leads-over-the-phone-4agn</guid>
      <description>&lt;p&gt;Every two minutes that an inbound lead waits to receive a call from your SDR lowers the likelihood of a closed deal by 5%. Instead of waiting for an SDR to call the lead or sending an automated email like everyone else, have a conversational AI app automatically call to the user as soon as they submit the form on your website.&lt;/p&gt;

&lt;p&gt;I previously wrote a &lt;a href="https://dasha.ai/en-us/blog/how-to-qualify-inbound-leads"&gt;tutorial&lt;/a&gt; on how such an app can be built using Dasha. Today we will integrate this app into a workflow, in less than an hour. We will use the recently deployed official Dasha Zapier integration to do this. For this tutorial we will use the following tools: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://daha.ai"&gt;Dasha&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zapier.com"&gt;Zapier&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://hubspot.com"&gt;Hubspot&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the process at a glance: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We create a stand-alone form on Hubspot with the fields "First Name", "Email" and "Phone". &lt;/li&gt;
&lt;li&gt;We point to this form submission as the action that initiates the Zap in Zapier. &lt;/li&gt;
&lt;li&gt;We launch a call with the Dasha Zapier integration and pass Name and Phone as input variables. &lt;/li&gt;
&lt;li&gt;Once the call is complete, we write all the collected information to specially created fields in the Hubspot lead card using another Zapier step. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, let's get started. &lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up your Dasha app
&lt;/h2&gt;

&lt;p&gt;For this tutorial we will reuse code that I wrote previously. It is a conversational AI app that qualifies inbound leads for a company (ACME Software) that sells a software for invoicing automation. At its core, the app checks if now is a good time to talk, asks a few questions and asks when a good time for the user to take a call from an account executive is. Let's get this application opened in your development environment. &lt;/p&gt;

&lt;p&gt;If you have never used Dasha before, you need to activate your API key. The API key lets you load your conversational application to the Dasha Cloud Platform, where it is executed. If you have your Dasha API key, ignore this part.  &lt;/p&gt;

&lt;p&gt;Make sure you have the latest Microsoft Visual Studio Code, Node.js and NPM installed. Dasha Studio is implemented as an extension to VSCode for your convenience. Open Visual Studio Code and install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=dasha-ai.dashastudio"&gt;Dasha Studio extension&lt;/a&gt; and Dasha Command Line Interface .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; dasha-ai.dashastudio &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; 
npm i &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="s2"&gt;"@dasha.ai/cli@latest"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, run a command to register your Dasha API key. A browser window will pop up and you will need to sign up for an account.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dasha account login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterwards, run to check your API key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dasha account info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you need to clone the inbound leads Dasha app and open the folder in which it is located. We will be cloning &lt;a href="https://github.com/dasha-samples/inbound-lead-qualification"&gt;this app&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/dasha-samples/inbound-lead-qualification
&lt;span class="nb"&gt;cd &lt;/span&gt;blank-slate-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In building Dasha apps in VSCode, you will mainly work with three files: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;main.dsl&lt;/strong&gt; is the Dasha Scripting Language file. DSL is a domain specific language, derived from TypeScript and used for the exclusive purpose of describing a conversation. You can read more about it in our &lt;a href="http://docs.dasha.AI"&gt;documentation&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;data.json&lt;/strong&gt; is the data set you provide to train the Dasha Cloud neural networks to recognize user &lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;intents&lt;/a&gt; and identify &lt;a href="https://dasha.ai/en-us/blog/named-entity-recognition"&gt;named entities&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;index.js&lt;/strong&gt; is the server-side JavaScript file to which the Dasha SDK is imported and which launches the contents of the &lt;strong&gt;/app&lt;/strong&gt; folder to the Dasha Cloud to be executed. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note that last bit. "launches the contents of the &lt;strong&gt;/app&lt;/strong&gt; folder to the Dasha Cloud to be executed". This means that when your Dasha application is launched from Zapier, it only functions as the contents of the &lt;strong&gt;/app&lt;/strong&gt; folder. &lt;/p&gt;

&lt;p&gt;Take a look at the &lt;strong&gt;main.dsl&lt;/strong&gt; file, namely the context variables, beginning at line 7.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context 
{
    input phone: string;
    input name: string = "";

    output software: string = "";
    output invoices: string = "";
    output lead_source: string = "";
    output calltimeday: string ="";

    calltime: string = "";
    callday: string = "";
    callback: string = "";
    visitedNodeTime: boolean = false;
    visitedNodeQuestion1: boolean = false;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that you are taking Input variables &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;phone&lt;/code&gt; and outputting variables &lt;code&gt;software&lt;/code&gt;, &lt;code&gt;invoices&lt;/code&gt;, &lt;code&gt;lead_source&lt;/code&gt; and &lt;code&gt;calltimeday&lt;/code&gt;. This is a key ingredient to the Zapier integration. We will input the &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;phone&lt;/code&gt; from the collected form data and output all of our output variables to be saved to the lead card in Hubspot. &lt;/p&gt;

&lt;p&gt;Now, you need to run a sample. It will serve two purposes. You will test the app and secondly, you will register the app in the Dasha Cloud to your account, so that you can refer to it from Zapier in building your integration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i 
npm start 12223334455 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where 12223334455 is your phone number in the international format. &lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up Hubspot
&lt;/h2&gt;

&lt;p&gt;Log into your Hubspot account. Everything we will do here today can be done with the free Hubspot package. We will do two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a stand-alone form &lt;/li&gt;
&lt;li&gt;Add a few custom Contact properties &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating a form
&lt;/h3&gt;

&lt;p&gt;On the top menu, hit Marketing &amp;gt; Lead capture &amp;gt; Forms. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/2GBYn3kQ5AKCPGBN4sA6Zq/418bfbc8e9dbc0c5107cdaf887f4fea6/Screenshot_at_Oct_08_10-09-00.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/2GBYn3kQ5AKCPGBN4sA6Zq/418bfbc8e9dbc0c5107cdaf887f4fea6/Screenshot_at_Oct_08_10-09-00.png" alt="Screenshot at Oct 08 10-09-00"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, click Create Form in the upper right corner, select Standalone Page from the Form menu and click Next. Pick Blank Template and click Next again. Name your form (I named mine "Zapier test form") and add the following fields: First Name, Last Name, email, Phone number. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/6iB6AobAWe6sWspOHMhPwF/1217372728796eecacc7e2788550f33c/Screenshot_at_Oct_08_10-13-20.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/6iB6AobAWe6sWspOHMhPwF/1217372728796eecacc7e2788550f33c/Screenshot_at_Oct_08_10-13-20.png" alt="Fields in your Hubspot form "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Update &amp;gt; Publish. You will get a pop up with the link to access the form. Copy this link and set it aside, we will need it to test the integration. &lt;/p&gt;

&lt;h3&gt;
  
  
  Create custom fields (properties) in Hubspot
&lt;/h3&gt;

&lt;p&gt;Refer back to the output variables in &lt;strong&gt;main.dsl&lt;/strong&gt;. We need to map fields in Hubspot to four output variables. Here is how I named mine in Hubspot: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;calltimeday &amp;gt; call_time_day_test &lt;/li&gt;
&lt;li&gt;invoices &amp;gt; invoices_test&lt;/li&gt;
&lt;li&gt;lead_source &amp;gt; lead_source_test&lt;/li&gt;
&lt;li&gt;software &amp;gt; software_test &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Click on Settings, then Properties and finally Create Property. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/JYegbGLJcxSCgEy0rpAq6/3296aca24f1f0987d13785f7269fe948/Screenshot_at_Oct_08_10-17-38.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/JYegbGLJcxSCgEy0rpAq6/3296aca24f1f0987d13785f7269fe948/Screenshot_at_Oct_08_10-17-38.png" alt="Settings &amp;gt; Properties &amp;gt; Create Property in Hubspot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;br&gt;
Object Type &amp;gt; Contact &lt;br&gt;
Group: Contact information &lt;br&gt;
Label: &lt;code&gt;your name for the property&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/2WMSycfVpOUUFECf7dFbvp/1f8f70ffddb07381b8f8b6f0ef585050/Screenshot_at_Oct_08_10-36-28.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/2WMSycfVpOUUFECf7dFbvp/1f8f70ffddb07381b8f8b6f0ef585050/Screenshot_at_Oct_08_10-36-28.png" alt="Creating a new Property in Hubspot "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit Next, and select field type: single line text. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/34FSLtWOUgY4blayFOkQ0R/fa74d8ee7b7728ab953aa294df575acd/Screenshot_at_Oct_08_10-37-06.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/34FSLtWOUgY4blayFOkQ0R/fa74d8ee7b7728ab953aa294df575acd/Screenshot_at_Oct_08_10-37-06.png" alt="Screenshot at Oct 08 10-37-06"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do the same for the other 3 properties. &lt;/p&gt;

&lt;p&gt;Now, let's make these properties clearly visible on the lead card, so that you can easily look at the results of the test. Open any contact by going to Contacts &amp;gt; Contacts and clicking on any one of them. Now, scroll a bit down and click "View all properties". &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/w6LeagyyS417iFxuz1oei/8c72741d973619982e287038ee920d0e/Screenshot_at_Oct_08_10-39-43.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/w6LeagyyS417iFxuz1oei/8c72741d973619982e287038ee920d0e/Screenshot_at_Oct_08_10-39-43.png" alt="View all properties in Hubspot "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, search for each of your newly added properties by their name and click "Add to your view" &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/VncrpJVjdu0Ltz7utVstb/31af3c8d827fb8e39fa59667936069c9/Screenshot_at_Oct_08_10-41-44.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/VncrpJVjdu0Ltz7utVstb/31af3c8d827fb8e39fa59667936069c9/Screenshot_at_Oct_08_10-41-44.png" alt="Add custom property to your Hubspot contact card view "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great, our Hubspot is ready to go. Before moving to the next step, use that link to the form that you copied earlier to open up the form in a browser window, fill it out and submit. Use your real phone number in the international format (12223334455). This will give us some data for Zapier to use in the next step. &lt;/p&gt;

&lt;h2&gt;
  
  
  Create a custom Zapier Zap integration
&lt;/h2&gt;

&lt;p&gt;Log into your &lt;a href="https://zapier.com"&gt;`Zapier&lt;/a&gt; account. The Zap we are building is a complex multi step integration. Zapier free users only get to build two step integrations, so you will need to get the 7 day free trial of premium Zapier personal account to build this integration. &lt;/p&gt;

&lt;p&gt;Once sorted, click "Create Zap" in the upper left corner. Name the Zap and search for Hubspot as the first kick off event. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/13Et3NEsVJaGjWvC50E7gO/402593a018ee8575d0e83d60d76f5cee/Screenshot_at_Oct_08_10-47-51.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/13Et3NEsVJaGjWvC50E7gO/402593a018ee8575d0e83d60d76f5cee/Screenshot_at_Oct_08_10-47-51.png" alt="Add Hubspot as starter event to your Zapier Zap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose "new form submission" for the trigger event and hit "Continue". In the next step you will need to add a hubspot account. If you've never used one, click "+ Connect a new account". Once connected, click "Continue". Now you will be asked to set up the Trigger. Choose your Hubspot form name from the drop-down, click refresh fields and click "Continue". If you have previously filled out the Hubspot form, you should see something like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/3NKHb6zJW3msDjuybmY0WZ/6110a1c8ca562a8c76cc23c62a5bd8c1/Screenshot_at_Oct_08_10-56-30.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/3NKHb6zJW3msDjuybmY0WZ/6110a1c8ca562a8c76cc23c62a5bd8c1/Screenshot_at_Oct_08_10-56-30.png" alt="Step 1 of the Zap complete "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click "Continue" and search for "Dasha" for Step 2. We will now connect Zapier to Dasha Conversational AI API. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/5qxujiAtEiAFwwKoKEiKJk/cd2011bf3116a42e1b819deffb2d662f/Screenshot_at_Oct_08_10-57-43.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/5qxujiAtEiAFwwKoKEiKJk/cd2011bf3116a42e1b819deffb2d662f/Screenshot_at_Oct_08_10-57-43.png" alt="Search for Dasha for Step 2 of the Zap "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Action Event Drop-down, select "Make a Call" and "Continue".  In the next "Choose account" drop-down, select your account and click "continue". &lt;/p&gt;

&lt;p&gt;On the next screen, choose "Provided by Dasha" for the dropdown "SIP Trunk to use", choose "inbound-leads" for the "Application to use" dropdown and select the upper-most value for "Application to use" dropdown. Once you select the application, two new fields should appear: "Phone" and "Name". These are the input variables required by the Dasha app. Select from the drop down appropriate fields, as collected by the Hubspot form. (Note if the fields "Name" and "Phone" do not appear, hit the "refresh fields" button). &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/3cnvOx36sp5eEH5SaoeyKw/9489d9dac272ee8d7ae86f3ec9f1ed28/Screenshot_at_Oct_08_11-02-20.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/3cnvOx36sp5eEH5SaoeyKw/9489d9dac272ee8d7ae86f3ec9f1ed28/Screenshot_at_Oct_08_11-02-20.png" alt="Almost done with Step 2 of our Zap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click "Test &amp;amp; Continue". You should get a call from your Dasha app. You will likely not see proper data appear in Zapier, do not fret, this seems to be the way it works. Once your Zap is complete, it will work as you want it to. &lt;/p&gt;

&lt;p&gt;Click the little plus sign below to go to the next step. &lt;/p&gt;

&lt;p&gt;In order to write data to Hubspot, we need to have the Contact ID number. Since we do not have it, we have to first make a request to Hubspot API to find the contact's ID using the contact's email (which we do have). Choose Hubspot under "action". For dropdown "Action event" look for "Find Contact". Next, select your Hubspot account. In the Set Up Action menu, select "Contact Information: Email" under "FIrst search property name" and for "First search property value" choose the email field from the first action (Hubspot form submission). &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/6rqP8v56DZlTUeMQKWKbPm/666880d5873682d400b46104fd55ab48/Screenshot_at_Oct_08_13-23-09.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/6rqP8v56DZlTUeMQKWKbPm/666880d5873682d400b46104fd55ab48/Screenshot_at_Oct_08_13-23-09.png" alt="Set up the action for retrieving contact's Object ID from Hubspot "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click "Continue" and then "Test &amp;amp; Continue." Now, click the + sign to create a new action. This final action will let us write the data collected by Dasha to the contact card in Hubspot. &lt;/p&gt;

&lt;p&gt;Select Hubspot and "Action event": Update contact. Hit "Continue". Choose your Hubspot account and hit "Continue" again. Under Object ID select the ID value we hav received in the previous step. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/7u6IvP2KubK6SPYmEsRolZ/cf9594bfefc80911321cbc32478848a9/Screenshot_at_Oct_08_13-37-58.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/7u6IvP2KubK6SPYmEsRolZ/cf9594bfefc80911321cbc32478848a9/Screenshot_at_Oct_08_13-37-58.png" alt="Setting up writing data to Hubspot "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, scroll down to find all the property field names we have previously added to Hubspot: &lt;br&gt;
&lt;code&gt;call_time_day_test&lt;/code&gt;&lt;br&gt;
&lt;code&gt;invoices_test&lt;/code&gt;&lt;br&gt;
&lt;code&gt;lead_source_test&lt;/code&gt;&lt;br&gt;
&lt;code&gt;software_test&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;For each, select the appropriate output data type from "Step 2 - Make a Call with Dasha", as such: &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/1OqXaoPO4TmRMdcV2eOEUd/7a218cc9bbfe2a4dbeec79331bd297f2/Screenshot_at_Oct_08_13-39-55.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/1OqXaoPO4TmRMdcV2eOEUd/7a218cc9bbfe2a4dbeec79331bd297f2/Screenshot_at_Oct_08_13-39-55.png" alt="Select proper Dasha output data to be written to Hubspot "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit "Continue" when you are done and "Turn on Zap".  &lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the Hubspot-Dasha-Hubspot Zapier integration
&lt;/h2&gt;

&lt;p&gt;Now to the fun part. Fill out your form again. Within 30 seconds you should get a call from Dasha. Give it all the information it asks for. Now, go to your lead card in Hubspot, you should see something like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.contentful.com/pzhspng2mvip/1USZMvzOj00p3rqQLv2dMg/38cd3ec0235134fc43f25c2a3cdd1bd0/Screenshot_at_Oct_08_15-44-43.png" class="article-body-image-wrapper"&gt;&lt;img src="//images.contentful.com/pzhspng2mvip/1USZMvzOj00p3rqQLv2dMg/38cd3ec0235134fc43f25c2a3cdd1bd0/Screenshot_at_Oct_08_15-44-43.png" alt="Your collected data in Hubspot "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In conclusion - you should make changes to the Dasha app, adapt it to the realities of your use case and tell us how it went in the &lt;a href="https://community.dasha.ai"&gt;Dasha community&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>vscode</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AI devops squad to the rescue: How to use voice AI to make your site reliability engineering more efficient </title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Wed, 06 Oct 2021 18:44:36 +0000</pubDate>
      <link>https://dev.to/dashaai/ai-devops-squad-to-the-rescue-how-to-use-voice-ai-to-make-your-site-reliability-engineering-more-efficient-a4a</link>
      <guid>https://dev.to/dashaai/ai-devops-squad-to-the-rescue-how-to-use-voice-ai-to-make-your-site-reliability-engineering-more-efficient-a4a</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://dasha.ai/en-us/blog/voice-AI-site-reliability-engineering"&gt;https://dasha.ai/en-us/blog/voice-AI-site-reliability-engineering&lt;/a&gt; by Arthur Grishkevich&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Voice AI and site reliability engineering? What a ridiculous match up. The two live in completely different worlds. The former in the world of pesky call centers, the latter in the world of ponytailed sys admins. &lt;/p&gt;

&lt;p&gt;I could end my post here if not for one thing. I signed up to give a lecture on using voice AI for site reliability engineering at conf42. Why would I do a stupid thing like that? Because I had a vision of how the two can work together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro and definitions
&lt;/h2&gt;

&lt;p&gt;In this tutorial we will use the following technologies and tools: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Webhooks
&lt;/li&gt;
&lt;li&gt;HTTPS requests &lt;/li&gt;
&lt;li&gt;Site reliability monitoring (we will use Better Uptime)&lt;/li&gt;
&lt;li&gt;Conversational voice AI (we will use Dasha) &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First, let's do definitions: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Site reliability engineering - principles of software engineering applied to infrastucture and operations problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Incident - something bad that happens to your site. In other words, your site was up, an incident happens, now it's down. Incidents are reported by site reliability monitors. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Incident acknowledgement - once an incident is reported, it has to be confirmed by a responsible individual (you).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Incident resolution - after incident is acknowledged, it has to be resolved (that is, if you want your website to be up and running again).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conversational AI app - an automated conversation built for a specific need, integrated with tools you already use, powered by AI.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's wrong with the current incident reporting workflow?
&lt;/h2&gt;

&lt;p&gt;Nothing really wrong with it but it can be made more efficient. &lt;/p&gt;

&lt;p&gt;As an example, let's look at &lt;a href="https://betteruptime.com"&gt;Better Uptime&lt;/a&gt;, since this is what we will be integrating with. You add a domain for Better Uptime to monitor. Every 30 seconds it sends an HTTP and ping request to the website. If the website is down, an incident is created. At this point, you are notified either via email, SMS, phone call or by sending out a webhook wherever you specify. &lt;/p&gt;

&lt;p&gt;Once the incident is created, it needs to go through two more lifecycle stages. Stage one is - acknowledgement, the responsible user need to acknowledge the incident happened. The next stage is resolution - the same user or a different user with access to this monitor needs to set the incident as resolved. After its resolution, Better Uptime checks again to see if the website is indeed up.&lt;/p&gt;

&lt;p&gt;How do I think this can be made more efficient? By adding a devops conversational AI app that will call the user when an incident happens, provide updates to the user from additional services (Kubernetes cluster, TLS certificates, etc.), be able to notify co-workers and finally, set the acknowledge and resolve statuses in Better Uptime.  There are two main use cases/benefits I see here: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The responsible user may be away from their machine, as the incident happens. They can check some of the systems from their phone and maybe even resolve the issue but why force them to waste time logging into Better Uptime if they can just put the phone on speaker and resolve everything with the AI app? &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The user might indeed be at their computer but to resolve the incident would have to log onto a half dozen websites and click tons of things. With the AI app they will be able to get all info/data they need through a simple voice question, as well as set appropriate incident statuses in Better Uptime.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And I'm sure you will find a dozen more ways in which this tech would be useful in your devops workflow. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;"But Arthur," I hear you shout "you said that Better Uptime can notify the responsible user through a phonecall when the incident happens. All on its own!" &lt;/p&gt;

&lt;p&gt;I certainly did say that. But it is not a conversational phone call. It's a very simple "Hi there, you had an incident. Bye." call. Which is still great. But can be made much better. &lt;/p&gt;

&lt;p&gt;Here is what I built: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=TeJAFI993_0"&gt;Embedded content: &lt;/a&gt;&lt;a href="https://www.youtube.com/watch?v=TeJAFI993_0"&gt;https://www.youtube.com/watch?v=TeJAFI993_0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here is how you can build it in ten easy steps to build our SRE conversational AI for devops: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Better Uptime account. &lt;/li&gt;
&lt;li&gt;Activate Dasha API key.&lt;/li&gt;
&lt;li&gt;Create a server for Better Uptime to monitor.&lt;/li&gt;
&lt;li&gt;Create a server to listen to webhooks from Better Uptime and launch the Dasha app.&lt;/li&gt;
&lt;li&gt;Build a Dasha conversational app that will call to you when an incident is created; set up external functions and HTTPS requests to Better Uptime.&lt;/li&gt;
&lt;li&gt;Set up nodemailer to email yourself a transcript of the conversation. &lt;/li&gt;
&lt;li&gt;Set up .env.&lt;/li&gt;
&lt;li&gt;Set up a tunnelling service to your localhosts. &lt;/li&gt;
&lt;li&gt;Set up the monitors and webhooks on Better Uptime. &lt;/li&gt;
&lt;li&gt;Test. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I urge you to follow the tutorial and build this thing on your own. Yet if you want it, here is the &lt;a href="https://github.com/dasha-samples/site-reliability-monitor-handler"&gt;source code&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a Better Uptime Account
&lt;/h2&gt;

&lt;p&gt;First off, you'll need a Better Uptime account. Unfortunately, to send webhooks out you will need a paid account. And we will need to send webhooks. There are at least a dozen Better Uptime alternatives that I was able to find, some of which might offer free webhooks. I'm using Better Uptime because we already use it for our SRE workflows at Dasha. &lt;/p&gt;

&lt;p&gt;So, step 1, go to &lt;a href="https://betteruptime.com"&gt;Better Uptime&lt;/a&gt; and register an account. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Activate Dasha API key
&lt;/h2&gt;

&lt;p&gt;Now, you need to activate your Dasha API key. If you have your Dasha API key, ignore this part. Open Visual Studio Code and install the Dasha Studio extension and Dasha Command Line Interface .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; dasha-ai.dashastudio &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; 
npm i &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="s2"&gt;"@dasha.ai/cli@latest"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, run a command to register your Dasha API key. A browser window will pop up and you will need to sign up for an account.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dasha account login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterwards, run to check your API key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dasha account info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you need to clone a blank Dasha app and open the folder in which it is located. We will be cloning &lt;a href="https://github.com/dasha-samples/blank-slate-app"&gt;this app&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/dasha-samples/blank-slate-app
&lt;span class="nb"&gt;cd &lt;/span&gt;blank-slate-app
npm i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Create a server for Better Uptime to monitor
&lt;/h2&gt;

&lt;p&gt;In the root of the folder you've got open in VSCode, create a new Node.js  file. You can name it anything, I named it &lt;strong&gt;helloworld.js&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Use this code for the super simple server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hostname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;127.0.0.1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/plain&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World. Server is up.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Server running at http://${hostname}:${port}/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, launch it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node helloworld.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Create a server to listen to webhooks from Better Uptime and launch the Dasha app
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;index.js&lt;/strong&gt; and delete all code. We will start from scratch here. We will do much more than just create the webhook listener server. We will build a Node.js application that will launch your Dasha AI conversational app, collect data from the app, send HTTPS requests to Better Uptime when your Dasha app requires it and email a formatted transcript of the conversation to your specified email address.  &lt;/p&gt;

&lt;p&gt;We will use Express.js to run the server. We will also use fs, Dasha SDK, body-parser, json2html, axios and dotenv.  Let's start off with the declarations and go ahead and create the server. :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dasha&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@dasha.ai/sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bodyParser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;body-parser&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hook&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1919&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;json2html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node-json2html&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;hook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text/plain&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World. Server running on port &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;. Listening for incidents on http://1543a913a2c7.ngrok.io As soon as incident is identified, I will initiate a call from Dasha AI to ackgnowledge or address the incident. &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;hook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bodyParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="nx"&gt;hook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;🚀 Server running on port ${PORT}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's create the webhook listener. Note that Better Uptime sends a webhook out whever an incident is created, acknowledged or resolved. We only need to launch the AI call when the incident is created. I got the JSON structure above from the Better uptime &lt;a href="https://docs.betteruptime.com/api/incidents-api"&gt;Incidents API documentation&lt;/a&gt;. Please refer to the comments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;hook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/hook&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Call your action on the request here&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Responding is important&lt;/span&gt;
  &lt;span class="c1"&gt;// save incidentID from JSON as const incidentId &lt;/span&gt;
  &lt;span class="c1"&gt;// we will need it to send acknowledged and resolved requests to Better Uptime &lt;/span&gt;
  &lt;span class="nx"&gt;incidentId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
  &lt;span class="c1"&gt;// we also save acknowledged and resolved statuses.&lt;/span&gt;
  &lt;span class="c1"&gt;// we will need these to keep Dasha from calling you when your incident is acknowledged or resolved&lt;/span&gt;
  &lt;span class="nx"&gt;acknowledged&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;acknowledged_at&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;resolved&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolved_at&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// log the statuses &lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;incidentID: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;incidentId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;acknowledged: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;acknowledged&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;resolved: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;resolved&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Better Uptime sends out webhooks on created, acknowledged, resolved statuses for each incident &lt;/span&gt;
  &lt;span class="c1"&gt;// we only need to run the Dasha app when the incident is created, thus we do the following: &lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;acknowledged&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;resolved&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Incident &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;incidentId&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; acknowledged.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;acknowledged&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;resolved&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Incident &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;incidentId&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; resolved.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; 
  &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Incident &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;incidentId&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; created. Expect a call from Dasha.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Launch the function running the Dasha app  &lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;calldasha&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;incidentId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's define the Dasha App function. Note the &lt;code&gt;// external functions begin&lt;/code&gt; and &lt;code&gt;// external functions end&lt;/code&gt;. We will add code for external functions here as we get to this point in creating our Dasha conversation. &lt;/p&gt;

&lt;p&gt;Please refer to the comments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;calldasha&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;incidentId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;dasha&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// external functions begin &lt;/span&gt;

  &lt;span class="c1"&gt;// external functions are called from your Dasha conversation in the body of main.dsl file &lt;/span&gt;
  &lt;span class="c1"&gt;// external functions can be used for calculations, data storage, in this case, to &lt;/span&gt;
  &lt;span class="c1"&gt;// call external services with HTTPS requests. You can call an external function from DSL&lt;/span&gt;
  &lt;span class="c1"&gt;// in your node.js file and have it do literally anything you can do with Node.js.&lt;/span&gt;

  &lt;span class="c1"&gt;// external functions end&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;conv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createConversation&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; 
    &lt;span class="na"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; 
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dasha&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phone&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;chat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;dasha&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createConsoleChat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;transcription&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phone&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;chat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;transcription&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;//create directory to save transcriptions&lt;/span&gt;
  &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mkdirSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;transcriptions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;recursive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;transcription&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transcription&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;//save the transcript of the conversation in a file  &lt;/span&gt;
  &lt;span class="c1"&gt;// or you can upload incident transcriptions to your incident management system here&lt;/span&gt;
  &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;transcriptions/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;incidentId&lt;/span&gt;&lt;span class="p"&gt;??&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.log&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;transcription&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt; 

  &lt;span class="c1"&gt;// and  email it to yourself&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;transcript&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;json2html&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transcription&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;html&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;span&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;${speaker} at ${startTime}: ${text} &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]});&lt;/span&gt;
  &lt;span class="nx"&gt;sendemail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transcript&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dispose&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To test. Your server should run. When you set the webhook address up on Better Uptime and have this server running, a Dasha conversation will be initiated every time a new incident is created. Let's build the Dasha app. &lt;/p&gt;

&lt;h2&gt;
  
  
  5. Build a Dasha conversational app that will call to you when an incident is created
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;main.dsl&lt;/strong&gt;. This is a Dasha Scripting Language file. DSL is a domain specific language, derived from TypeScript and used for the exclusive purpose of describing a conversation. You can read more about it in our &lt;a href="https://docs.dasha.ai/en-us/default/dasha-script-language/"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As always, we start off with declarations. Let's declare input variables and external functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context 
{
    input phone: string;
    input name: string;
}

// declare external functions here 
external function acknowledge(): string;
external function resolve(): string;
external function getstatusof( what:string? ): string;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we have the AI app wait for speech (the user should say "hello" or something of the sort), then greet the user, inform of the incident and wait for instructions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;start node root {
    do {
        #connectSafe($phone);
        wait *;
    }
    transitions {
        hello: goto hello on true;        
    }
}

node hello {
    do { 
        #sayText("Hello " + $name + "! This is Dasha calling you regarding your website. There has been an incident. "); 
        #sayText("You can acknowledge or resolve the incident right on the call with me. "); 
        #sayText(" Please note, I will listen and take notes until you mention that you are ready to resolve or acknowledge. ", interruptible:true);
        wait *;
    }
    transitions {
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that I said "wait for instructions." In this case, the instructions will come in the form of a digression. A digression is a node in Dasha Scripting Language which does not necessarily flow from a previous node but can be called up at absolutely any point in the conversation. The digression becomes active when a specific intent is identified in the user's reply. Intents are defined as a data set in &lt;strong&gt;data.json&lt;/strong&gt; used to train the &lt;a href="https://dasha.ai/en-us/blog/dasha-conversational-ai-as-a-service"&gt;Dasha Cloud&lt;/a&gt; neural network. Digressions are also useful in giving your app a human-like feel. You can read more about digressions in &lt;a href="https://dasha.ai/en-us/blog/using-digressions"&gt;this post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this application we will have three key digressions for three key actions that the user can perform. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Acknowledge the incident. &lt;/li&gt;
&lt;li&gt;Resolve the incident. &lt;/li&gt;
&lt;li&gt;Ignore the incident.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We will also add four additional digressions to make the conversation more efficient: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask Dasha to wait while the user thinks something over or looks something up. &lt;/li&gt;
&lt;li&gt;Ask Dasha to repeat what she last said.&lt;/li&gt;
&lt;li&gt;Easter egg digression "oops".&lt;/li&gt;
&lt;li&gt;Journal node - lets Dasha know to not react unless an intent is identified. This lets us passively record any notes that the user makes to self, as he is resolving the incident. &lt;/li&gt;
&lt;li&gt;Get status of vital services. * &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are two steps to implementing digressions - define intents (create data set) in &lt;strong&gt;data.json&lt;/strong&gt; and write out the code for the digressions in &lt;strong&gt;main.dsl&lt;/strong&gt;.  We will also need to write external functions in our &lt;strong&gt;index.js&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the data set to train the Dasha neural network
&lt;/h3&gt;

&lt;p&gt;Since digressions are activated by intents, we need to define our intents training data set in &lt;strong&gt;data.json&lt;/strong&gt;. Once you run your conversational AI app, your &lt;strong&gt;data.json&lt;/strong&gt; file is loaded in the Dasha Cloud, where it is used to train the neural network. The &lt;code&gt;"includes"&lt;/code&gt; section for each intent is where you provide a set of phrases on which the neural net is trained to then recognize the user intent. You can (and should) read up on intents in the &lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;blog post&lt;/a&gt; by Ilya Ovchinnikov, the ML team lead who built out this engine for Dasha. Open up the file and delete everyting in it. Paste the code below in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"v2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"intents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"yes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"yes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sure"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yep"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"I confirm"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"confirmed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"I do"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yeah"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"that's right"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"excludes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"no"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"repeat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"acknowledge"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I acknowledge the incident"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"I can acknowledge the incident"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"I do acknowledge the incident"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"acknowledge"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"acknowledge please"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"incident acknowledged"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"resolve"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ignore"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"oops"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"wait"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"What is the status of (kubernetes)[statusentity]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"Dasha, what's the status of (kubernetes)[statusentity] and (TLS)[statusentity]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"What's the status of (kubernetes)[statusentity]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"Tell me about the status (healthcheck)[statusentity]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"Give me an update on the status of (healthcheck)[statusentity]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"Status (healthcheck)[statusentity] and (TLS)[statusentity]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"Dasha, let's look at the status of (TLS)[statusentity]"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"entities"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"statusentity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"open_set"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"values"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"kubernetes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"Kubernetes cluster"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cooper netease"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"kubernetes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Kubernetes instances"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"for burnett"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Kubernetes deploy"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TLS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SSL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TLS/SSL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TLS certificate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"certificate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SSL certificate"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"healthcheck"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"site healthchecks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"health check "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"site health checks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"health checks"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see here a few complete intents (&lt;code&gt;"acknowledge", "yes"&lt;/code&gt;) that you will need to activate your digressions. The format is simple to follow - intent name is followed by a list of phrases (&lt;code&gt;"includes"&lt;/code&gt;) the user might use to signify their intent. You can follow this same format to specify phrases to define intents for the other digressions listed above. &lt;/p&gt;

&lt;p&gt;Note the &lt;code&gt;"status"&lt;/code&gt; digression. It is a compound intent and relies on &lt;a href="https://dasha.ai/en-us/blog/named-entity-recognition"&gt;named entities&lt;/a&gt; to function. &lt;/p&gt;

&lt;p&gt;In this case, we are looking to identify two things within the user's phrase. One is the intent to "check the status of something" and the other is what the "something" is. The "something" is defined by named entities. Using named entity recognition, the neural network powering your app in the Dasha Cloud extracts important data from the user's speech. &lt;/p&gt;

&lt;p&gt;You can always refer to the &lt;a href="//."&gt;app source code&lt;/a&gt; to get a copy of my &lt;strong&gt;data.json&lt;/strong&gt; file. &lt;/p&gt;

&lt;h3&gt;
  
  
  Writing the digressions in main.dsl
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// acknowledge flow begins 
digression acknowledge {
    conditions { on #messageHasIntent("acknowledge"); }
    do {
        #sayText("Can you please confirm that you want me to acknowledge the incident?");
        wait *;
    } 
    transitions {
        acknowledge: goto acknowledge_2 on #messageHasIntent("yes");
        donotacknowledge: goto waiting on #messageHasIntent("no");
    }
}

node acknowledge_2 {
    do {
        external acknowledge();
        #sayText("Got it. I have set the status in Better Uptime as acknowledged. The next step is to resolve the incident.");
        wait *;
    } 
    transitions
    {
    }
}

node waiting {
    do{
        #sayText("Okay. I will wait for your instructions then. ");
        wait *;
    } 
}

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

&lt;/div&gt;



&lt;p&gt;The code above is for &lt;code&gt;__digression acknowledge__&lt;/code&gt; use it as an example to write code for the digressions &lt;strong&gt;resolve&lt;/strong&gt; and &lt;strong&gt;ignore&lt;/strong&gt;.  Note that you do not need to recreated the &lt;code&gt;node waiting&lt;/code&gt; - you only need to define it once and can call this node from other nodes or digressions, as needed. &lt;/p&gt;

&lt;h3&gt;
  
  
  Getting your node.js external functions to call external APIs
&lt;/h3&gt;

&lt;p&gt;Note the &lt;code&gt;external acknowledge();&lt;/code&gt;.  Here we are calling out to the external function &lt;code&gt;acknowledge&lt;/code&gt; which we have defined in the beginning of main.dsl. &lt;/p&gt;

&lt;p&gt;As you recall, external functions call out to a specific function in &lt;strong&gt;index.js&lt;/strong&gt;. We even left some space in our &lt;strong&gt;index.js&lt;/strong&gt; file specifically for our external functions. &lt;/p&gt;

&lt;p&gt;You can go ahead and paste the following code into your &lt;strong&gt;index.js&lt;/strong&gt; between &lt;code&gt;// external functions begin&lt;/code&gt; and &lt;code&gt;external functions end&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  // external functions are called from your Dasha conversation in the body of main.dsl file 
  // external functions can be used for calculations, data storage, in this case, to 
  // call external services with HTTPS requests. You can call an external function from DSL
  // in your node.js file and have it do literally anything you can do with Node.js.

  // External function. Acknowledge an incident in Betteruptime through posting HTTPS  
  app.setExternal("acknowledge", (args, conv) =&amp;gt; 
  {
    // this keeps the code from throwing an error if we are testing with blank data
    if (incidentId === null)
    return;

    const config = {
      // remember to set your betteruptimetoken in .env
      headers: { Authorization: "Bearer " + process.env.betteruptimetoken }
    };

    const bodyParameters = { key: "value" };

    axios.post( "https://betteruptime.com/api/v2/incidents/" + incidentId + "/acknowledge", bodyParameters, config)
    .then(console.log)
    .catch(console.log);

  });

  // External function. Resolve an incident in Betteruptime through posting HTTPS  
  app.setExternal("resolve", (args, conv) =&amp;gt; 
  {  
    if (incidentId === null)
    return;

    const config = {
      headers: { Authorization: "Bearer "+ process.env.betteruptimetoken }
    };

    const bodyParameters = { key: "value" };

    axios.post( "https://betteruptime.com/api/v2/incidents/" + incidentId + "/resolve", bodyParameters, config)
    .then(console.log)
    .catch(console.log);
  });

  // external function getting status of additional services 
  app.setExternal("getstatusof", (args, conv) =&amp;gt; 
  {
    switch (args.what)
    {
      case "kubernetes":
        return "Kubernetes is up and running";
      case "healthcheck":
        return "Site health checks are not responding";
      case "TLS":
        return "TLS Certificate is active";
    }
  }); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take a look at &lt;code&gt;app.setExternal("acknowledge")&lt;/code&gt;. As you can see we are making an HTTPS post request to the Better Uptime API and are using the &lt;code&gt;incidentId&lt;/code&gt; variable we collected when we first got the inbound webhook notifying us of incident creation. I referred to the Better Uptime &lt;a href="https://docs.betteruptime.com/api/incidents-api"&gt;API documentation&lt;/a&gt; for this. &lt;/p&gt;

&lt;h3&gt;
  
  
  Additional digressions in your Dasha app
&lt;/h3&gt;

&lt;p&gt;Go back to your &lt;strong&gt;main.dsl&lt;/strong&gt;. We need to add a few more digressions to make our app complete. Append these to your &lt;strong&gt;main.dsl&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// get status of vital services 
digression status  {
    conditions { on #messageHasIntent("status") &amp;amp;&amp;amp; #messageHasData( "statusentity" ); }
    do {
        for (var e in #messageGetData("statusentity") ){ 
            var result = external getstatusof(e.value );
            #sayText( result );
        }
        return;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Digression &lt;strong&gt;status&lt;/strong&gt; becomes activated on that complex intent/named entity hybrid we built. If Intent &lt;code&gt;"status"&lt;/code&gt; is identified AND the message carries data &lt;code&gt;"statusentity"&lt;/code&gt;, we collect the data (note: &lt;code&gt;#messageGetData&lt;/code&gt; collects data as an array) and send each data point to external function &lt;code&gt;getstatusof&lt;/code&gt; which, in turn, returns a string which Dasha pronounces out to the user. Please look at the &lt;code&gt;app.setExternal("getstatusof")&lt;/code&gt; in the JavaScript code above. This function returns dummy data for the demo. Obviously in production, you would want to call out to specific end points to get realistic data here. &lt;/p&gt;

&lt;p&gt;Now, add this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// additional digressions 
digression @wait {
    conditions { on #messageHasAnyIntent(digression.@wait.triggers)  priority 900; }
    var triggers = ["wait", "wait_for_another_person"];
    var responses: Phrases[] = ["i_will_wait"];
    do {
        for (var item in digression.@wait.responses) {
            #say(item, repeatMode: "ignore");
        }
        #waitingMode(duration: 70000);
        return;
    }
    transitions {
    }
}

// this digression tells Dasha to only respond to user replies that trigger an intent
// this is a very helpful little piece of code for our particular use case because 
// the user might talk to themselves as they are resolving the incident
// everyting the user says to themselves is logged (thus: journal) in the transcript 
// which can then be appended to the incident report 
digression journal {
    conditions { on true priority -1; }
    do {
        return;
    }
}

digression repeat {
    conditions { on #messageHasIntent("repeat"); }
    do {
        #repeat();
        return;
    }
} 

digression oops {
    conditions { on #messageHasIntent("oops"); }
    do {
        #sayText("What happened " + $name + "? Did you ue the wrong terminal again?");
        return;
    }
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Digressions &lt;code&gt;wait&lt;/code&gt; and &lt;code&gt;repeat&lt;/code&gt; help progress the conversation along. The user can ask Dasha to wait a minute, or to repeat her last phrase. The digression &lt;code&gt;oops&lt;/code&gt; is an easter egg, activated with the intent words "oops", "crap", or your favorite exclamation. The digression &lt;code&gt;journal&lt;/code&gt; tells the Dasha app to stay quiet until it hears the user say one of the specificly defined intents. Everything that the user says before the intent is loggled into the transcript. This digression lets the user dictate notes to Dasha which are then collated into the transcript. The transcript can be attached to your incident management system. In this case, we will email the transcript to a specified address. &lt;/p&gt;

&lt;h2&gt;
  
  
  6. Set up nodemailer to email yourself a transcript of the conversation
&lt;/h2&gt;

&lt;p&gt;Look at the last 11 lines of code in the function used for launching your Dasha app that you added to your &lt;strong&gt;index.js&lt;/strong&gt; earlier. Dasha conversation transcripts are JSON. In this code, we are formatting the JSON as HTML and emailing it. To email the code, we call the &lt;code&gt;sednemail(transcript)&lt;/code&gt; function.  &lt;/p&gt;

&lt;p&gt;Let's now add this function to our &lt;strong&gt;index.js&lt;/strong&gt; application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;sendemail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transcript&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nodemailer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;nodemailer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;transporter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;nodemailer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createTransport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gmail&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="c1"&gt;// be sure to specify the credentials in your .env file&lt;/span&gt;
        &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gmailuser&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;pass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gmailpw&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;mailOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gmailuser&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Incident conversation transcript&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;h2&amp;gt;Conversation transcript:&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;transcript&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="nx"&gt;transporter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendMail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailOptions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Email sent: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code will send an email from your Gmail account to the specified address. &lt;/p&gt;

&lt;h3&gt;
  
  
  7. Set up .env
&lt;/h3&gt;

&lt;p&gt;You will need to create .env file named &lt;strong&gt;".env"&lt;/strong&gt; (make sure you have dotenv installed). &lt;/p&gt;

&lt;p&gt;In this file you will need to define the following tokens and/or credentials:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;betteruptimetoken = 
name = 
phone =
sendto = 
gmailuser = 
gmailpw = 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;betteruptimetoken&lt;/code&gt; is, expectedly, your Better Uptime API token. If you are using a different service, rename the enviornment variable accordingly. If you are using Better Uptime, you can find the token by going to team members &amp;gt; configure team and scroll halfway down. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;name&lt;/code&gt; is quite literally the name which Dasha will use to refer to you. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;phone&lt;/code&gt; is the phone number Dasha will call you on. As with name, you are welcome to push this data to Dasha externally. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;sendto&lt;/code&gt; is the email address to which you want to send your transcript.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gmailuser&lt;/code&gt; is your Gmail email address. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;gmailpw&lt;/code&gt; is your Gmail password. &lt;/p&gt;

&lt;p&gt;There is a bit of nuance about those last two. You will need to have additional security disabled on your Gmail account to use simple auth like this. Your other option is writing our OAuth2 authentification as per this &lt;a href="https://stackoverflow.com/questions/26196467/sending-email-via-node-js-using-nodemailer-is-not-working"&gt;StackOverflow thread&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;At the end of this step, you should have all needed environment variables defined in your .env file. &lt;/p&gt;

&lt;h2&gt;
  
  
  8. Set up a tunnelling service to your localhosts.
&lt;/h2&gt;

&lt;p&gt;Open split terminals in your VSCode. In one, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node helloworld.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the other, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congrats, you should have two servers running. &lt;code&gt;helloworld.js&lt;/code&gt; on port 3000 and &lt;code&gt;index.js&lt;/code&gt; on port 1919. They are running as localhosts which will not do because we need them to interact with the web.  To solve this you can use a local tunnel. I used Ngrok but you can use any other one. &lt;/p&gt;

&lt;p&gt;To use Ngrok, you will need to sign up and follow these &lt;a href="https://dashboard.ngrok.com/get-started/setup"&gt;instructions&lt;/a&gt;. Once you have got Ngrok installed and authorized, open two terminal windows (I did outside of VSCode) and run this command in one:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;and this command in the other terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./ngrok http 1919 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create two internet domain names which will tunnel to your locally hosted servers. Note: you may have to purchase the paid Ngrok subscription for two tunnels. &lt;/p&gt;

&lt;h2&gt;
  
  
  9. Set up the monitors and webhooks on Better Uptime
&lt;/h2&gt;

&lt;p&gt;Let's assume that Ngrok gave you two domain names: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;12345.ngrok.io - localhost: 3000 (helloworld.js) (the server we are monitoring)&lt;/li&gt;
&lt;li&gt;67890.ngrok.io - localhost: 1919 (index.js) (the server which catches webhooks)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Go to &lt;a href="https://betteruptime.com"&gt;Better Uptime&lt;/a&gt; &amp;gt; Monitors &amp;gt; Create Monitor&lt;/p&gt;

&lt;p&gt;Enter "12345.ngrok.io" into the field "URL to monitor". Now, uncheck all boxes under On-call escalation (Call, send sms, send e-mail, push notification). Finally, hit Create monitor. &lt;/p&gt;

&lt;p&gt;Go back to the monitors page and you should see your monitor turn green. &lt;/p&gt;

&lt;p&gt;Now, go to Integrations &amp;gt; Exporting Data &amp;gt; Configure Webhooks &amp;gt; Add&lt;/p&gt;

&lt;p&gt;Give your webhook a name and list this Webhook URL: &lt;a href="http://67890.ngrok.io/hook"&gt;http://67890.ngrok.io/hook&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can hit send test webhook and watch the Terminal in your Dasha app. It should show something like this: &lt;/p&gt;

&lt;h2&gt;
  
  
  10. Test the entire app
&lt;/h2&gt;

&lt;p&gt;Now, to launch a full on call, the only thing you need to do is kill your helloworld server. Ctrl+с in the VSCode terminal running the &lt;code&gt;helloworld.js&lt;/code&gt; app and you will get an inbound webhook. Watch the terminal for &lt;code&gt;index.js&lt;/code&gt; and you will see a Dasha call initiated. The call will arrive on your phone ASAP, so make sure it is not in do not disturb mode. &lt;/p&gt;

&lt;p&gt;Congratulations! You have just built a conversational AI app for site reliability engineering automation.&lt;/p&gt;

&lt;p&gt;If you need it, here is the link to the &lt;a href="https://github.com/dasha-samples/site-reliability-monitor-handler"&gt;source code&lt;/a&gt; again. &lt;/p&gt;

&lt;p&gt;Let us know in the &lt;a href="https://community.dasha.ai"&gt;Dasha community&lt;/a&gt; how you did with this app. &lt;/p&gt;

</description>
      <category>vscode</category>
      <category>devops</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to connect jambonz with Dasha AI</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Tue, 05 Oct 2021 16:22:27 +0000</pubDate>
      <link>https://dev.to/dashaai/how-to-connect-jambonz-with-dasha-ai-5bd6</link>
      <guid>https://dev.to/dashaai/how-to-connect-jambonz-with-dasha-ai-5bd6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally posted on &lt;a href="https://dasha.ai/en-us/blog/how-connect-jambonz-dasha-AI" rel="noopener noreferrer"&gt;https://dasha.ai/en-us/blog/how-connect-jambonz-dasha-AI&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Note from the editor: this is a repost of David Horton's &lt;a href="https://blog.jambonz.org/how-to-connect-jambonz-with-dasha-ai" rel="noopener noreferrer"&gt;article&lt;/a&gt;. &lt;a href="https://jambonz.org" rel="noopener noreferrer"&gt;jambonz&lt;/a&gt; is an open source CPaaS for communications service providers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dasha.ai/en-us" rel="noopener noreferrer"&gt;Dasha&lt;/a&gt; is a conversational-AI-as-a-service platform that lets you embed realistic voice and text conversational capabilities into your apps or products.  Dasha is a relatively new entry in the conversational AI space, albeit one with that is &lt;a href="https://dasha.ai/en-us/blog/gartner-cool-vendor-dasha" rel="noopener noreferrer"&gt;getting some nice press&lt;/a&gt; and brings some interesting capabilities, including such things as handling conversational digressions more easily and a nice &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt; plugin for creating applications using their &lt;a href="https://docs.dasha.ai/en-us/default/dasha-script-language/" rel="noopener noreferrer"&gt;declarative language&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When building contact center solutions using &lt;a href="https://jambonz.org" rel="noopener noreferrer"&gt;jambonz&lt;/a&gt;, integrating with Dasha is a breeze!&lt;/p&gt;

&lt;h3&gt;
  
  
  Dasha side
&lt;/h3&gt;

&lt;p&gt;Make sure you have node.js version 13+ and npm installed. You will also want the latest version of Visual Studio Code running to edit and test the Dasha app.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Join &lt;a href="https://community.dasha.ai" rel="noopener noreferrer"&gt;Dasha Community&lt;/a&gt; - you will get your API key here automatically&lt;/li&gt;
&lt;li&gt;Open VSCode and install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=dasha-ai.dashastudio&amp;amp;ssr=false" rel="noopener noreferrer"&gt;Dasha Studio Extension&lt;/a&gt; from the extension store.  You’ll get all the DSL syntax highlighting and a GUI interface for debugging your conversation flow.&lt;/li&gt;
&lt;li&gt;Run &lt;strong&gt;&lt;code&gt;npm i -g "@dasha.ai/cli@latest"&lt;/code&gt;&lt;/strong&gt; to install the latest Dasha CLI.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Run a dasha app
&lt;/h3&gt;

&lt;p&gt;You’ll want to load up a Dasha conversational AI app. For the purposes of this tutorial, we will load up the simple &lt;a href="https://github.com/dasha-samples/dasha-sip-test" rel="noopener noreferrer"&gt;inbound tester app&lt;/a&gt; that they provide.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://github.com/dasha-samples/dasha-sip-test &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;dasha-sip-test &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;install

&lt;/span&gt;Cloning into &lt;span class="s1"&gt;'dasha-sip-test'&lt;/span&gt;...
remote: Enumerating objects: 66, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
remote: Counting objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;66/66&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
remote: Compressing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;51/51&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
remote: Total 66 &lt;span class="o"&gt;(&lt;/span&gt;delta 27&lt;span class="o"&gt;)&lt;/span&gt;, reused 41 &lt;span class="o"&gt;(&lt;/span&gt;delta 14&lt;span class="o"&gt;)&lt;/span&gt;, pack-reused 0
Unpacking objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;66/66&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

added 204 packages, and audited 205 packages &lt;span class="k"&gt;in &lt;/span&gt;2s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dasha integrates with voice systems over SIP.  That makes it super simple to integrate with jambonz.&lt;/p&gt;

&lt;p&gt;So the next thing we shall do is create a SIP endpoint on the hosted Dasha platform that we can send our calls to.  We will create a unique SIP URL that routes to their platform and which on the Dasha side is linked to our application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;dasha sip create-inbound &lt;span class="nt"&gt;--application-name&lt;/span&gt; sip-test-app sip-test-app
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"applicationName"&lt;/span&gt;: &lt;span class="s2"&gt;"sip-test-app"&lt;/span&gt;,
  &lt;span class="s2"&gt;"priority"&lt;/span&gt;: 0,
  &lt;span class="s2"&gt;"groupName"&lt;/span&gt;: &lt;span class="s2"&gt;"Default"&lt;/span&gt;,
  &lt;span class="s2"&gt;"uri"&lt;/span&gt;: &lt;span class="s2"&gt;"sip:5de44e6b-c0df-4532-b952-e4e4c5a5a9ec@sip.us.dasha.ai"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whoa, slow down!  What just happened there?&lt;/p&gt;

&lt;p&gt;We used the dasha cli to create a SIP URI on the Dasha platform that we can send to.  We specified an application name and a config name -- in this case, using &lt;code&gt;sip-test-app&lt;/code&gt; for both.  &lt;/p&gt;

&lt;p&gt;We can also use the dasha cli to list the sip-inbound endpoint we have created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;dasha sip list-inbound
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"sip-test-app"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"applicationName"&lt;/span&gt;: &lt;span class="s2"&gt;"sip-test-app"&lt;/span&gt;,
    &lt;span class="s2"&gt;"priority"&lt;/span&gt;: 0,
    &lt;span class="s2"&gt;"groupName"&lt;/span&gt;: &lt;span class="s2"&gt;"Default"&lt;/span&gt;,
    &lt;span class="s2"&gt;"uri"&lt;/span&gt;: &lt;span class="s2"&gt;"sip:5de44e6b-c0df-4532-b952-e4e4c5a5a9ec@sip.us.dasha.ai"&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can see the data returned is an object keyed by the config name where the values are objects containing information about an individual SIP URI.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that in order for everything to link up properly on the Dasha side, the &lt;code&gt;application-name&lt;/code&gt; you use in the &lt;code&gt;dasha sip create-inbound&lt;/code&gt; command must match the value in the &lt;code&gt;name&lt;/code&gt; field of your &lt;code&gt;dashaappfile&lt;/code&gt; (which is found in &lt;code&gt;app/app.dashaapp&lt;/code&gt;).  If you want to change the name of the application, change it in the dashaappfile and create a new sip inbound URI using that same name, then restart your app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now all we need to do is start our Dasha app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npm start &lt;span class="k"&gt;in&lt;/span&gt;

..skipping startup log messages here..

Waiting &lt;span class="k"&gt;for &lt;/span&gt;calls via SIP
sip:5de44e6b-c0df-4532-b952-e4e4c5a5a9ec@sip.us.dasha.ai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that it again tells us the SIP URI Dasha has exposed for our application.&lt;/p&gt;

&lt;h3&gt;
  
  
  jambonz side
&lt;/h3&gt;

&lt;p&gt;On the jambonz side, all we need to do is to &lt;a href="https://www.jambonz.org/docs/webhooks/dial/" rel="noopener noreferrer"&gt;dial&lt;/a&gt; an outbound call leg to that SIP URI provided.  Let's whip up a jambonz app to do just that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npx create-jambonz-app &lt;span class="nt"&gt;--scenario&lt;/span&gt; dial dasha-connect

Creating a new jambonz app &lt;span class="k"&gt;in&lt;/span&gt; /Users/dhorton/dasha/dasha-connect

Installing packages...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: you can see the finished app &lt;a href="https://github.com/jambonz/dasha-connect" rel="noopener noreferrer"&gt;here on github&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This gives us a basic demo jambonz application that by default dials a talking time clock.  Let's change it to dial the Dasha SIP URI instead.  &lt;/p&gt;

&lt;p&gt;First, let's rename the webhook file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;dasha-connect
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mv &lt;/span&gt;lib/routes/endpoints/dial-time.js lib/routes/endpoints/dial-dasha.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, replace the contents of &lt;code&gt;lib/routes/endpoints/dial-dasha.js&lt;/code&gt; with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;WebhookResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@jambonz/node-client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;WebhookResponse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locals&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;debug&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST /dial-dasha&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebhookResponse&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dial&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;answerOnBridge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sip&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;sipUri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sip:5de44e6b-c0df-4532-b952-e4e4c5a5a9ec@sip.us.dasha.ai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;503&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: replace the &lt;code&gt;sipUri&lt;/code&gt; above with your own SIP URI that you generated in the previous step.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can see that all we are doing is using the jambonz dial target type to dial out to a SIP URI.&lt;/p&gt;

&lt;p&gt;Finally, edit the &lt;code&gt;lib/routes/endpoints/index.js&lt;/code&gt; to reference &lt;code&gt;dial-dasha&lt;/code&gt; instead of &lt;code&gt;dial-time&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/call-status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./call-status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/dial-dasha&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./dial-dasha&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As with any jambonz Node.js app, we need to provide environment variables to reference our account sid and other details, so edit the &lt;code&gt;ecosystem.config.js&lt;/code&gt; file accordingly, then start it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pm2 start ecosystem.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that it's running, all we need to do is create an application in our jambonz portal for this webhook:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632667376844%2F-gRvaADWM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632667376844%2F-gRvaADWM.png" alt="dasha-app.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and then point a phone number to it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632667393265%2Fd7uDy417Z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632667393265%2Fd7uDy417Z.png" alt="dasha-pn.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it!  Time to test by calling the number we assigned.  This dasha sample app is quite simple so you will simply hear a woman's voice saying hello and then waiting for your response after which she will close out the conversation.  &lt;/p&gt;

&lt;p&gt;Of course, this simple Dasha app is only meant to provide an easy way to verify SIP connectivity, and you can now proceed to build out more sophisticated conversational AI apps using Dasha and connect them to your jambonz voice applications.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>vscode</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Conversational AI can handle order confirmation for you… and more.</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Thu, 09 Sep 2021 15:21:45 +0000</pubDate>
      <link>https://dev.to/dashaai/conversational-ai-can-handle-order-confirmation-for-you-and-more-38l2</link>
      <guid>https://dev.to/dashaai/conversational-ai-can-handle-order-confirmation-for-you-and-more-38l2</guid>
      <description>&lt;p&gt;Originally posted on dasha.ai/en-us/blog/order-confirmation-ai&lt;/p&gt;

&lt;p&gt;A new wave of conversational AI helps automate order confirmation — and potentially save your company money and time. All while skyrocketing your customer experience.&lt;/p&gt;

&lt;p&gt;The conversational AI market is booming. If you’ve been following developments, you’ll know that it goes by a lot of different names — chatbots, voicebots, personal assistants, etc. But at the end of the day, everyone agrees to use conversational AI as a cheaper and more accessible way to interact with users. One of the ways companies use conversational AI is to automate their order confirmation process.&lt;/p&gt;

&lt;p&gt;Grubhub, for instance, gets over 620,000 orders per day, and that’s just one food ordering app. UPS delivered 21.1 million packages on average in 2020. With such huge numbers of deliveries per day, it's essential for companies to make sure they can accurately and efficiently confirm the order and the delivery details.&lt;/p&gt;

&lt;p&gt;Why traditional order confirmation ways aren't efficient&lt;br&gt;
While some companies have implemented traditional order confirmation via text message or email, there are many drawbacks. The ability to confirm the order in real-time changes the entire customer experience. It saves time and money for the customer and improves their experience with the company. An order confirmation text is not the best method for companies that deliver perishable goods like flowers or food.&lt;/p&gt;

&lt;p&gt;What if the flowers arrive but the customer didn’t get the text? What if the food delivery was made to the wrong address? What if the right information wasn't provided correctly? Conversational AI tackles these issues by allowing you to easily and efficiently confirm orders in real-time. This article will explain how conversational AI can be used for order confirmation, and how you can automate it for your company.&lt;/p&gt;

&lt;p&gt;The order confirmation option is available in most apps right now. The customer and the delivery company both get a notification, and both parties can see the confirmation. However, some apps give the delivery company access to the order details, and not the customer. This can be problematic for the customer. The customer might not even realize their order was placed, and it would be very difficult to cancel and get a refund. Besides, it's not uncommon for the customer to have ordered something they didn't mean to order, be it an extra pizza, or jeans in the wrong size. The best way to avoid such errors is by calling the person who placed an order right after it has been placed. And you can do just that with an automated conversational AI order confirmation app.&lt;/p&gt;

&lt;p&gt;Why conversational AI is the best way to confirm orders&lt;br&gt;
In the U.S, online spending amounted to around $900 billion in 2020. With such a huge amount of spending, companies have to keep their order confirmation process as efficient as possible, and that’s what conversational AI does. If a company chooses to automate its order confirmation process, it doesn’t mean that it has to spend lots of time creating a conversational AI app. In fact, it only takes a couple of hours to write an order confirmation app with Dasha AI. Once done, your company will no longer need to bother with hiring personnel to handle order confirmation calls, conversational AI will do it in their stead.&lt;/p&gt;

&lt;p&gt;Besides, one of the greatest benefits of conversational AI apps is that you can not only automate the order confirmation process. The app can help you create the best customer experience by not only automatically confirming orders, but also ask customer experience and/or NPS survey questions such as,&lt;/p&gt;

&lt;p&gt;“Are you satisfied with your order?",&lt;br&gt;
"How would you rate the delivery process?",&lt;br&gt;
"Did the size of the [item ordered] fit you?",&lt;br&gt;
"Would you recommend [brand name] to your friends?."&lt;br&gt;
The applications of conversational AI apps are virtually limitless. Why waste time and money on a team of customer service people when you can "hire" a conversational AI app to do the work for you?&lt;/p&gt;

&lt;p&gt;With the right app, you can automate the process of connecting with customers and building an immediate rapport, since the person will hear a human voice on the other side of the phone. The best part is that, with conversational AI, you don’t need to create a separate app for every category of products. Whether it’s customer service, delivery confirmation, or product search or recommendation, the app can be created once and then used across different use cases.&lt;/p&gt;

&lt;p&gt;Benefits of automating processes with conversational AI&lt;br&gt;
There are several benefits to conversational AI automation:&lt;/p&gt;

&lt;p&gt;Increase customer satisfaction.&lt;br&gt;
Most companies see conversational AI as an opportunity for you to connect with your customers in a human-like, most natural manner. In turn, they get happier and more engaged. Moreover, you can nudge your customers to respond to questions and/or requests as they come in.&lt;/p&gt;

&lt;p&gt;Increase customer retention and loyalty.&lt;br&gt;
Newer, smarter customers have become harder to retain. If you want to win back these customers, you have to offer a better experience. You can use Dasha AI to make calls that are more personal and specific to the customer. For example, you can ask if they would be happy with a discount, or you can send a generous promo code in case they weren't fully satisfied with the previous order.&lt;/p&gt;

&lt;p&gt;Gaining new customers with conversational AI.&lt;br&gt;
Baymard Institute states that nearly 70% of carts get abandoned. Whole 7 out of 10 potential customers leave the purchasing process mid-way. Yet conversational AI could be a game-changer. With Dasha, you could create a conversational AI app that would call those potential customers. Dasha will remind them about the unfinished order, thus reducing the abandoned cart rate and increasing the conversion rate.&lt;/p&gt;

&lt;p&gt;Also, your company can analyze customer behavior and know that they’d be most likely to purchase a product if they have already got similar ones. Then, you can mark these new customers as potential prospects, create a compelling personalized offer.&lt;/p&gt;

&lt;p&gt;Get honest feedback.&lt;br&gt;
The best way to learn if your company is doing well is by asking your customers about their experience. Use a conversational AI app to ask questions about their opinion on their order, or even ask feed company and how you could improve the experience. Take a look at how NPS surveys are automated with a conversational AI app in this post.&lt;/p&gt;

&lt;p&gt;Reduce cancellations.&lt;br&gt;
When your customer places an order and gets a confirmation from the merchant, they feel reassured and are more likely to complete the transaction. However, many times, the customer realizes that they made a mistake during the ordering process. It could be because the company changed prices, or a different product was ordered. But as a result of having paid for it, the customer would want to get a refund. With conversational AI, the customer would not only be able to revise their food delivery, clothes, or tech device order, but cancel it right after the purchase was complete, shall they have a change of heart.&lt;/p&gt;

&lt;p&gt;How the conversational AI order confirmation process works&lt;br&gt;
With Dasha, the interactions with customers aren't troublesome to automate. Companies can focus more on other things while conversational AI does most of the work dealing with customers.&lt;/p&gt;

&lt;p&gt;Before I get into describing the process, I encourage you to take a look at this how-to post on how I created an order delivery conversational AI app in just a couple of hours.&lt;/p&gt;

&lt;p&gt;Without further ado, with Dasha, the order confirmation process is done as follows:&lt;/p&gt;

&lt;p&gt;Once your company gets an order request, they will be given a call from Dasha and the person on the other line will sound like a human. At this point Dasha will already have all the necessary information needed such as ordered items, customer's name, and delivery address, to proceed with the order confirmation.&lt;/p&gt;

&lt;p&gt;Next, Dasha will proceed conversing with the customer regarding their order and say things like: "Hi Jessica, this is Dasha from [company name] calling to confirm your order. I see you've ordered [item 1] and [item 2] to be delivered to [customer's address]. Would you like to change anything about your order?" and go from there.&lt;/p&gt;

&lt;p&gt;Dasha conversational AI can also ask the customer about their preferred paying method and shall it be a card, process the payment right there and then.&lt;/p&gt;

&lt;p&gt;Once Dasha has confirmed the order, the order can then be passed on to the fulfillment team to prepare the order.&lt;/p&gt;

&lt;p&gt;The order is then delivered (or shipped) to your customer's address. Once the shipping/delivery process is initiated, Dasha can call back the customer to confirm that the package or the delivery is on its way.&lt;/p&gt;

&lt;p&gt;This, in essence, is how conversational AI saves your company time and money, by taking care of the customer service aspect of the order, thus allowing companies to spend more time improving their other services.&lt;/p&gt;

&lt;p&gt;Develop an AI ordering system yourself (it's easy!)&lt;br&gt;
Take a look at how the conversation would go once you create the order confirmation app:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/J4JuK6ds8PE"&gt;https://youtu.be/J4JuK6ds8PE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since creating an order confirmation conversational AI app takes only a couple of hours, I encourage you to try developing an app yourself! You don't need a team of developers to write it, using Dasha is intuitive and doesn't require any programming knowledge, so come as you are! In case you run into any difficulties, we're always here to help you in Dasha Developer Community, so join us! :)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Take order confirmation to a new level with conversational AI</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Tue, 31 Aug 2021 19:22:03 +0000</pubDate>
      <link>https://dev.to/dashaai/take-order-confirmation-to-a-new-level-with-conversational-ai-20a1</link>
      <guid>https://dev.to/dashaai/take-order-confirmation-to-a-new-level-with-conversational-ai-20a1</guid>
      <description>&lt;p&gt;Today we’ll be taking a look at how to create a conversational AI app that automates order confirmation. While this app will be targeted towards confirming a food delivery order, yet the logic of this app can apply to create virtually any order confirmation app. Let’s get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prep steps to create conversational AI apps with Dasha
&lt;/h2&gt;

&lt;p&gt;In order to get access to the community of like-minded developers, have all your questions answered, and get help with app development the moment you need it, join &lt;a href="https://community.dasha.ai/"&gt;Dasha Developer Community&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once done, you’ll need to download the latest versions of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://nodejs.dev/"&gt;NodeJS&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://code.visualstudio.com/Download"&gt;VSCode&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.npmjs.com"&gt;NPM&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open VSCode, go to extensions and download the &lt;a href="https://marketplace.visualstudio.com/items?itemName=dasha-ai.dashastudio&amp;amp;ssr=false"&gt;Dasha Studio&lt;/a&gt; extension. You use the studio to create your conversational script, it gives you syntax analysis and highlights the code. There's also a visual graph editor and it has a GUI tool for debugging.&lt;/p&gt;

&lt;p&gt;All done with the downloads!&lt;/p&gt;

&lt;p&gt;Now you can go ahead and download &lt;strong&gt;&lt;a href="https://github.com/dasha-samples/blank-slate-app"&gt;Dasha Blank Slate app&lt;/a&gt;&lt;/strong&gt; source code and use it as a base to write your code. You can also refer to the &lt;strong&gt;source code&lt;/strong&gt; of this order confirmation conversational AI app* that you can download &lt;a href="https://github.com/dasha-samples/food-order-confirmation"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You would want to install the latest version of Dasha CLI. Do that by opening the Terminal in VSCode and running this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i -g "@dasha.ai/cli"&lt;/code&gt;&lt;br&gt;
&lt;code&gt;npm i&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You could also run a live chat at any moment of time with the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm start chat&lt;/code&gt; (text chat)&lt;br&gt;
&lt;code&gt;npm start your_phone_number&lt;/code&gt; (voice chat. Instead of “your_phone_number” type the number of your phone)&lt;/p&gt;

&lt;p&gt;With these commands, you’ll be able to converse with the AI in text form. This will not only help you test the conversational flow but also gauge whether there are any errors in the code.&lt;/p&gt;
&lt;h2&gt;
  
  
  Get to know the files you’ll use to create human-like conversational AI apps
&lt;/h2&gt;

&lt;p&gt;There are 3 main files you need to know about and use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;main.dsl&lt;/strong&gt; -- here you’ll write DashaScript Language code to create the workflow of your conversational AI app. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;data.json&lt;/strong&gt; -- you will set the &lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;intents&lt;/a&gt; and &lt;a href="https://dasha.ai/en-us/blog/named-entity-recognition"&gt;entities&lt;/a&gt; (/NER/Named Entity Recognition) in this file. The neural network will use intents and entities you’ll create to learn.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;index.js&lt;/strong&gt; -- a NodeJS file that launches the Dasha SDK. You’ll be adding any external functions you deem necessary once adapting the code to your company’s needs. External functions are needed to process data in JavaScript or to get or push data from external APIs. For example, you may need to process data, get access to databases or APIs or use it for any other purposes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Create your order confirmation conversational AI app!
&lt;/h2&gt;

&lt;p&gt;Off to creating your 2-in-1 ai food delivery and order confirmation app!&lt;/p&gt;

&lt;p&gt;Start with importing the common library. It provides all the pre-programmed replies to common digressions such as “wait”, “are you a robot?”, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import the commonReactions library so that you don't have to worry about coding the pre-programmed replies
import "commonReactions/all.dsl";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you want to establish the context. Here you’ll write the variables, both input (the ones available at the start of the conversation) and output (the variables AI will receive, store and use throughout the conversation).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context
{
// Declare the input variable - phone. It's your hotel room phone number and it will be used at the start of the conversation.  
    input phone: string;
// Storage variables. You'll be referring to them across the code. 
    appetizers: string="";
    drinks: string="";
    new_burger: string="";
    street: string="";
    house_num: string="";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you’ve set the variables, write out the start node named root. In it, under the &lt;code&gt;do&lt;/code&gt; command, you’ll let the AI know that it needs to connect to the user’s phone, wait for 1 second, and then say some kind of a welcome message and wait for the reply (&lt;code&gt;wait *;&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Once the user says something, the AI will go to the next node. Under &lt;code&gt;transitions&lt;/code&gt; you can either write directions to the specified nodes, or leave it blank in case you want the transitions to be not to any of the nodes, but to one of the digressions. In this case, we have &lt;code&gt;next: goto order_confirmation_start on true;&lt;/code&gt; -- this means that the transition will happen despite what the user says.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// A start node that always has to be written out. Here we declare actions to be performed in the node. 
start node root
{
    do
    {
        #connectSafe($phone); // Establishing a safe connection to the user's phone.
        #waitForSpeech(1000); // Waiting for 1 second to say the welcome message or to let the user say something
        #sayText("Hi, this is Dasha, I'm calling to verify some informaton regarding your order with ABC Burgers."); // Welcome message
        wait *; // Wating for the user to reply
    }
    transitions // Here you give directions to which nodes the conversation will go
    {
        next: goto order_confirmation_start on true;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we programmed the AI to go to node &lt;code&gt;order_confirmation_start&lt;/code&gt;, let’s write it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node order_confirmation_start
{
    do 
    {   
        #sayText("Yeah, hi, so I see that you've ordered a cheeseburger to be delivered to 78 Washington Road. Do you want to change anything about your order?"); 
        wait*;
    }
    transitions
    {
        payment_method: goto payment_method on #messageHasIntent("no");
        edit_new_order: goto edit_new_order on #messageHasIntent("yes");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that after &lt;code&gt;#sayText&lt;/code&gt; we wrote a random order to a random address. However, you should create an external function (you’ll be doing that in index.js file as we’ve discussed above) and connect it to your internal ordering system, that will pull the information on the order and the delivery address of the user.&lt;/p&gt;

&lt;p&gt;Considering that the user knows the menu and wants to change the burger they are ordering, let’s write out the corresponding node and &lt;a href="https://dasha.ai/en-us/blog/using-digressions"&gt;digression&lt;/a&gt;. The reason we should write out both is that we’ll be referring to this node in another node’s transition, and the digression will be there to get triggered at any point of the conversation should there be a need for it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression change_order_burger
{
    conditions {on #messageHasData("burger_kind");}
    do 
    {   
        set $new_burger = #messageGetData("burger_kind")[0]?.value??"";
        #sayText("Perfect. I've added " + $new_burger + " to your order. Would you like anything else?"); 
        wait *;
    }
    transitions
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes") or #messageHasIntent("order_sth_else");
    }
}

node change_order_burger
{
    do 
    {   
        set $new_burger = #messageGetData("burger_kind")[0]?.value??"";
        #sayText("Perfect. I've added " + $new_burger + " to your order. Would you like anything else?"); 
        wait *;
    }
    transitions
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes") or #messageHasIntent("order_sth_else");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, let’s write the node we mention in the transition (+ a corresponding digression):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression edit_new_order
{
    conditions {on #messageHasIntent("order_sth_else");}
    do
    {
        #sayText("What can I get for you?"); 
        wait *; 
    }
}

node edit_new_order
{
    do
    {
        #sayText("What can I get for you?"); 
        wait *; 
    }
    transitions
    {

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a simple, yet multifunctional node in a way since we’ll be transferring to it in multiple nodes.&lt;/p&gt;

&lt;p&gt;Another similar digression and node are the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node nvm
{
        do
    {
        #sayText("Is there anything else I can help you with?"); 
        wait *;
    }
    transitions
    {
        payment_method: goto payment_method on #messageHasIntent("no");
        edit_new_order: goto edit_new_order on #messageHasIntent("yes");
    }
}

digression nvm
{
    conditions {on #messageHasIntent("nvm");}
    do
    {
        #sayText("Okay! How may I help you?"); 
        wait *; 
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’ll also have a chance to refer to them in other nodes.&lt;/p&gt;

&lt;p&gt;Let’s write a digression for a case when a person asks about the burger menu after deciding to change the order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression burgers_available
{
    conditions {on #messageHasIntent("burgers_available");}
    do 
    {
        #sayText("We've got cheeseburger, hawaiian burger, buffalo chicken burger, creamy mushroom burger, beef burger and barbeque burger. Which one would you like?"); 
        wait*;
    }
    transitions
    {
        change_order_burger: goto change_order_burger on #messageHasData("burger_kind");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty simple!&lt;/p&gt;

&lt;p&gt;Now, what if the user wants to change the delivery address? Let’s program the conversational AI app to be able to deal with this case scenario.&lt;/p&gt;

&lt;p&gt;There could be 4 different paths here. Either the user states they want to change the address without specifying it, or they name the new street, or the new building number, or the full address. We should write down a digression for each of these scenarios as they can pop up at any moment during the conversation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression different_address
{
    conditions {on #messageHasIntent("different_address");}
    do
    {
        #sayText("Sounds good, could you tell me the building number and the street name, please?"); 
        wait *; 
    }
}

digression change_street
{
    conditions {on #messageHasIntent("change_street");}
    do 
    {
        set $street = #messageGetData("street")[0]?.value??"";
        #sayText("Okay, I changed the street to " + $street + " . Is there anything else you'd like to change?"); 
        wait *;
    }
    transitions
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes") or #messageHasIntent("order_sth_else");
        review_full_order: goto review_full_order on #messageHasIntent("no");
    }
}

digression change_house_num
{
    conditions {on #messageHasIntent("change_house_num");}
    do 
    {
        set $house_num = #messageGetData("house_num")[0]?.value??"";
        #sayText("Gotcha, I changed the building number to " + $house_num + " . Is there anything else you'd like to change?"); 
        wait *;
    }
    transitions
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes") or #messageHasIntent("order_sth_else");
        review_full_order: goto review_full_order on #messageHasIntent("no");
    }
}

digression change_address
{
    conditions {on #messageHasData("house_num") and #messageHasData("street");}
    do 
    {
        set $street = #messageGetData("street")[0]?.value??"";
        set $house_num = #messageGetData("house_num")[0]?.value??"";
        #sayText("Okay, changed the delivery address to " + $house_num + " " + $street + ". Is there anything else you'd like to change?"); 
        wait *;
    }
    transitions
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes") or #messageHasIntent("order_sth_else");
        review_full_order: goto review_full_order on #messageHasIntent("no");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take a look at the digression &lt;code&gt;change_street&lt;/code&gt; the line under the &lt;code&gt;do&lt;/code&gt; command: &lt;code&gt;set $street = #messageGetData("street")[0]?.value??"";&lt;/code&gt;. You might recognize &lt;code&gt;$street&lt;/code&gt; from the content that we’ve established right off the bat. This line lets the AI store the variable &lt;code&gt;$street&lt;/code&gt; and use it throughout the chat.&lt;/p&gt;

&lt;p&gt;Note that we can store multiple variables under the &lt;code&gt;do&lt;/code&gt; section as seen under &lt;code&gt;change_address&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We’ll use the stored variables right in the digressions to provide feedback to the user, letting them know we’ve understood them correctly and make some changes if we didn’t.&lt;/p&gt;

&lt;p&gt;Now, let’s consider the case when the user decides to edit their order by ordering something extra that’s on our menu. Appetizers, for instance. Remember that the user might know the menu and say exactly what they want to order, or they might ask what you have on the menu appetizers-wise:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression appetizers
{
    conditions {on #messageHasIntent("appetizers");}
    do 
    {
        #sayText("We've got fried calamari, french fries, spring salad, and a soup of the day. What of these would you like to order?");
        wait *;
    }
    transitions 
    {
       confirm_appetizers: goto confirm_appetizers on #messageHasData("appetizers");
    }
     onexit
    {
        confirm_appetizers: do {
        set $appetizers =  #messageGetData("appetizers", { value: true });
       }
    }
}
node confirm_appetizers
{
    do
    {
        var sentence = "Perfect. I've added ";
        set $appetizers = #messageGetData("appetizers");
        for (var item in $appetizers) {
            set sentence = sentence + (item.value ?? " and ");
        }
        set sentence = sentence + " to your order. Is there anything else you'd like?";
        #sayText(sentence); 
        wait *;
    }
     transitions 
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes") or #messageHasIntent("drinks");
        confirm_drinks: goto confirm_drinks on #messageHasData("drinks");
        review_full_order: goto review_full_order on #messageHasIntent("no");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same thing goes for the drinks menu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression drinks
{   
    conditions {on #messageHasIntent("drinks");}
    do 
    {
        #sayText("We have orange juice, Sprite, and vanilla milkshakes. What would you like to get?");
        wait *;
    }
    transitions 
    {
       confirm_drinks: goto confirm_drinks on #messageHasData("drinks");
    }
    onexit
    {
        confirm_drinks: do {
        set $drinks = #messageGetData("drinks", { value: true });
       }
    }
}

node confirm_drinks
{
    do
    {
        var sentence = "Noted, I added ";
        set $drinks = #messageGetData("drinks");
        for (var item in $drinks) {
            set sentence = sentence + (item.value ?? " and "); // In case the guest desides to order multiple items of food
        }
        set sentence = sentence + " to your order. Anything else you'd like to order?";
        #sayText(sentence); 
        wait *;
    }
     transitions 
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes") or #messageHasIntent("appetizers");
        confirm_appetizers: goto confirm_appetizers on #messageHasData("appetizers");
        review_full_order: goto review_full_order on #messageHasIntent("no");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we’re done changing the order, we should provide the user with the final confirmation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node review_full_order
{
    do
    {
        var sentence = "To review your order, you want to get ";
        for (var item in $new_burger) {
            set sentence = sentence + (item.value ?? "") + (", ");
        }
        for (var item in $appetizers) {
            set sentence = sentence + (item.value ?? "") + (", and ");
        }
        for (var item in $drinks) {
            set sentence = sentence + (item.value ?? "");
        }
        set sentence = sentence + ". Would you like anything else?"; 
        #sayText(sentence); 
        wait *;
    }
     transitions 
    {
        payment_method: goto payment_method on #messageHasIntent("no");
        edit_new_order: goto edit_new_order on #messageHasIntent("yes");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we write out the &lt;strong&gt;for&lt;/strong&gt; statements to account for multiple food/drink items (for example, if the user says they want both calamari and fries). The &lt;code&gt;+ (", ");&lt;/code&gt; and &lt;code&gt;+ (", and ");&lt;/code&gt; so that the multiple variables are separated when the text is spoken (fries, Hawaiian burger, and Sprite vs friedHawaiian burgerSprite). &lt;/p&gt;

&lt;p&gt;Now, a couple of simple nodes will let the AI know it needs to ask about the payment method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node payment_method
{
    do
    {
        #sayText("Gotcha. Now, would you be paying with cash or by card?");
        wait *;
    }
     transitions 
    {
        with_cash: goto with_cash on #messageHasIntent("cash");
        by_card: goto by_card on #messageHasIntent("card");
    }
}

node with_cash
{
    do
    {
        #sayText("Sounds good, with cash it is. Your order will be ready in 15 minutes. Thank you for your order! Bye bye!");
        exit;
    }
}

node by_card
{
    do
    {
        #sayText("Sounds good, by card it is. Your order will be ready in 15 minutes. Thank you for your order! Bye bye!");
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It goes without saying that we need to account for the case scenario when the user wants to cancel the order altogether:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression cancel_order
{   
    conditions {on #messageHasIntent("cancel_order");}
    do 
    {
        #sayText("Okay, just cancelled your order. Is there anything else I can help you with?");
        wait *;
    }
    transitions 
    {
        edit_new_order: goto edit_new_order on #messageHasIntent("yes");
        bye: goto bye on #messageHasIntent("no");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the final touch is our &lt;code&gt;bye&lt;/code&gt; node and digression. We don’t ever want the user to not have an option to end the conversation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression bye 
{
    conditions { on #messageHasIntent("bye"); }
    do 
    {
        #sayText("Thanks for your time. Have a great day. Bye!");
        #disconnect();
        exit;
    }
}

node bye 
{
    do 
    {
        #sayText("Thanks for your time. Have a great day. Bye!");
        #disconnect();
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create your own conversational AI app! It’s easy :)
&lt;/h2&gt;

&lt;p&gt;Try creating an order confirmation app that fits your business’ needs. Think of the questions your users could ask, plot them and write out corresponding nodes and digressions. Or improve the app and share the results in &lt;a href="https://community.dasha.ai/"&gt;Dasha Developer Community&lt;/a&gt; :) &lt;/p&gt;

</description>
      <category>vscode</category>
      <category>javascript</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to get started with customer service automation at your bank. A quick start guide for a simple money transfer AI app.</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Fri, 27 Aug 2021 18:20:58 +0000</pubDate>
      <link>https://dev.to/dashaai/how-to-get-started-with-customer-service-automation-at-your-bank-a-quick-start-guide-for-a-simple-money-transfer-ai-app-4l0c</link>
      <guid>https://dev.to/dashaai/how-to-get-started-with-customer-service-automation-at-your-bank-a-quick-start-guide-for-a-simple-money-transfer-ai-app-4l0c</guid>
      <description>&lt;p&gt;So you’re considering using customer support automation at your bank but are unsure where to begin. The good news is you’re at the right place. &lt;/p&gt;

&lt;p&gt;In this guide we’ll talk about why it is a smart decision to use artificial intelligence in banking, how to use customer service and support automation, and will provide you with a step-by-step guide on creating your own automated money transfer app.&lt;/p&gt;

&lt;h2&gt;
  
  
  What exactly are the benefits of automation for banking industry?
&lt;/h2&gt;

&lt;p&gt;Automation is a catalyst for growth for companies. It’s tough to imagine a company that’s not deploying at least some sort of automated procedures. Without automation you are bound to have persistent human errors, overheads and reduced operational efficiency. &lt;/p&gt;

&lt;p&gt;According to a &lt;a href="https://drive.google.com/file/d/1N9bD4dSzvOcZ3F6OO-MMxmQXF6xgpnwU/view"&gt;Pega robotic automation case study&lt;/a&gt;, automating customer experience reduced error rates down to 2% (from an approximate of 30% rate), reduced processing time&lt;br&gt;
by a whole 78% and accounts processed number increased twofold. &lt;/p&gt;

&lt;p&gt;Customer service and support automation helps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;avoid repetitive tasks,&lt;/li&gt;
&lt;li&gt;employees to focus on focal projects and task, &lt;/li&gt;
&lt;li&gt;reduce operational costs,&lt;/li&gt;
&lt;li&gt;scale the business,&lt;/li&gt;
&lt;li&gt;reduce AHT,&lt;/li&gt;
&lt;li&gt;be available to customers on a 24/7 basis, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Why you should use customer support automation in banking
&lt;/h2&gt;

&lt;p&gt;Let’s start with something that affected nearly all consumer banking customers.&lt;/p&gt;

&lt;p&gt;During 2020, the number of times when the customers were put on hold for hours while trying to reach their bank are immense. Some of the clients had to spend three, five, and some even ten hours on hold, which greatly diminished their satisfaction with the banking experience. By letting artificial intelligence take care of incoming calls, banks that employed such tech managed not only to increase CX and to improve customer loyalty and satisfaction, but also avoided unnecessary work, which would’ve been their CS team spending time resolving complaints. This is just one example of how invaluable customer support automation is for the banking industry.&lt;/p&gt;

&lt;p&gt;There is no question whether utilizing artificial intelligence in banking is a must in 2021. According to &lt;a href="https://www.ey.com/en_gl/news/2020/02/artificial-intelligence-will-be-an-essential-business-driver-for-financial-services-within-two-years-according-to-study-co-sponsored-by-ey"&gt;EY press release&lt;/a&gt;, 68% of financial institutions executives are planning to “use AI for new revenue generation, process automation, risk management, customer service and client acquisitions within two years”. And there’s no wonder why: “AI can potentially unlock $1 trillion of incremental value for banks, annually”, as per &lt;a href="https://www.mckinsey.com/industries/financial-services/our-insights/ai-bank-of-the-future-can-banks-meet-the-ai-challenge#"&gt;McKinsey&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The banking industry can rest assured that using automation will get their customers’ requests answered promptly and accurately. While AI can handle most customer questions, some require complex problem solving, human interaction and creativity, in which case calls get transferred securely to a human operator. &lt;/p&gt;

&lt;p&gt;One of the most compelling reasons for utilizing artificial intelligence in banking is self-explanatory: cost saving. According to &lt;a href="https://www.businessinsider.com/ai-in-banking-report"&gt;Business Insider&lt;/a&gt;, front- and middle-office AI uses provide banks with a cost saving opportunity of $416 billion. Think about that. &lt;/p&gt;

&lt;p&gt;Now, let’s consider some AI implementation use cases for banks. You will see that AI in banking customer service is indispensable.&lt;/p&gt;

&lt;p&gt;Conversational AI is a hype nowadays and it’s justified. There are myriad ways artificial intelligence can be used in banking. Banks use it to automate the way customer can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;submit a loan application,&lt;/li&gt;
&lt;li&gt;report a stolen or lost card,&lt;/li&gt;
&lt;li&gt;check balance of their accounts,&lt;/li&gt;
&lt;li&gt;schedule an appointment with a bank representative,&lt;/li&gt;
&lt;li&gt;transfer money, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these use cases can be easily and seamlessly be solved with Dasha Studio. Without further ado, let’s take a look at how anyone with little to no coding skills can create the last point mentioned in the list, money transfer. &lt;/p&gt;
&lt;h2&gt;
  
  
  How to automatically conduct a money transfer with a simple conversational AI app
&lt;/h2&gt;

&lt;p&gt;Let’s take a look at a Dasha conversational AI demo for the money transfer use case.&lt;/p&gt;

&lt;p&gt;First things first, you’ll need to install &lt;a href="https://code.visualstudio.com/"&gt;Visual Studio&lt;/a&gt;, &lt;a href="https://nodejs.org/en/download/"&gt;Node.js&lt;/a&gt;, join &lt;a href="http://community.dasha.ai/"&gt;Dasha’s developer community&lt;/a&gt; (that’d allow you to get any help you need), and finally download a money transfer code demo. If that sounds confusing to you, don’t fret. We have a &lt;a href="https://dasha.ai/en-us/blog/virtual-receptionist-software"&gt;step-by-step guide&lt;/a&gt; that will allow you to do everything in a matter of minutes (you can go straight to the “Installing Dasha Studio and loading a pre-built AI virtual receptionist app” part).&lt;/p&gt;

&lt;p&gt;Now to the fun part! Let’s take a look at the code. &lt;/p&gt;

&lt;p&gt;In order to see the full picture of what’s happening in the code without actually distracting yourself with the code lines themselves, check out the Graph Editor. It will show you the pathways conversation might take place. The Graph Editor essentially shows you all the high-level nodes. (P.S. a node describes the system's actions in the current state and the conditions for transitioning to other nodes. For more information on DashaScript language structure (dsl), check out the &lt;a href="https://docs.dasha.ai/en-us/default/dasha-script-language/"&gt;Documentation&lt;/a&gt; link).&lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/4rwugba6aKMpOBpnnFsuMl/59904cd6fdc230060108dd01e013b9f5/Graph_Editor.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/4rwugba6aKMpOBpnnFsuMl/59904cd6fdc230060108dd01e013b9f5/Graph_Editor.jpg" alt="Graph Editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: if you can’t see the pathways, just zoom out. It should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/6dy7PydjuyTpsA7enoX1kg/4b1614d235168951c8f419ea6d095a80/Graph_Editor_-_zoom_out.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/6dy7PydjuyTpsA7enoX1kg/4b1614d235168951c8f419ea6d095a80/Graph_Editor_-_zoom_out.jpg" alt="Graph Editor - zoom out"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point, zoom in a bit. What you are seeing are digressions. Nodes that have no other nodes leading into them. A user can call a digression up at any point in the conversation. This functionality emulates the way in which humans communicate with each other. For more info on digressions, take a look at this post. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/4ACtFsHktj34wdnvIGGPIY/fa27ef66aef72c6aec4a398c824ce3b3/Graph_Editor_-_zoom_in.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/4ACtFsHktj34wdnvIGGPIY/fa27ef66aef72c6aec4a398c824ce3b3/Graph_Editor_-_zoom_in.jpg" alt="Graph Editor - zoom in"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s get to the most important part - the code. Open file &lt;strong&gt;main.dsl&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/689Sr8aJdm8LjFRhaZ8CE0/71fc6011905af3091f575e95237e37fc/Main.dsl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/689Sr8aJdm8LjFRhaZ8CE0/71fc6011905af3091f575e95237e37fc/Main.dsl.jpg" alt="Main.dsl"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With line 1 we import common libraries. In line 7 we declare alias for a type and in lines 12-22 we declare variables for context. The variables will be used later to store data received from the user in the course of the conversation. &lt;/p&gt;

&lt;p&gt;The lines 34-43 describe what happens at the start of the chat between AI and the customer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;start node root
{
    do
    {
        #connectSafe($phone);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;tells us that Dasha safely connected to a customer’s phone. moving on to the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#waitForSpeech(1000);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;means that Dasha will wait for 1000ms (1 second) and move on to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#say("greeting");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which means Dasha will greet the customer and after that it’ll wait for them to respond:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wait *;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lines 43-47 describe the transition the app makes once an event is triggered. In this case we see &lt;strong&gt;#messageHasIntent("transfer_money");&lt;/strong&gt;, which refers to the intent &lt;strong&gt;transfer_money&lt;/strong&gt;, which is when the customer specifies their intention to transfer money from one account to another. &lt;/p&gt;

&lt;p&gt;It’s now the best time to take a look at the intents themselves. But what are intents? Intents are reusable within the application. It means that you can use it in different steps of the conversational script. You don't need to define individual ones for different transitions, except for those cases when it's necessary for your script. Intent classification is aimed to categorize phrases by their meanings (intention). (Note: for more information on intents you can check out &lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;this blog post&lt;/a&gt; which focuses on them).&lt;/p&gt;

&lt;p&gt;Go to data.json to view all the specified intents  As you can see, there are 2 main parts to each intent: &lt;strong&gt;includes&lt;/strong&gt; and &lt;strong&gt;excludes&lt;/strong&gt;. &lt;strong&gt;Includes&lt;/strong&gt; part shows all the specified phrases a customer can say to trigger &lt;strong&gt;transition&lt;/strong&gt;. In this case, a customer talks about their intention to have their money transfered. The &lt;strong&gt;excludes&lt;/strong&gt; part describes the phrases that need to be prevented from being included in the intent so that the app doesn’t trigger the unexpected response. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/Mp5nLES9QrFgWWdNNKmox/21b477b31154a837d937bd2b55a0397d/Data.json.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/Mp5nLES9QrFgWWdNNKmox/21b477b31154a837d937bd2b55a0397d/Data.json.jpg" alt="Data.json"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Moving on to lines 48-64. The &lt;strong&gt;onexit&lt;/strong&gt; node section is defined right after transitions section and allows to specify actions to perform before exiting the node. The app goes on to perform the lines 66-115, starting with the &lt;strong&gt;preprocessor digression transfer_data&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;preprocessor digression transfer_data
{
    conditions
    {
        on true;
    }

    var amount: string = "";
    var source_account: string="";
    var target_account: string="";
    var account: string ="";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here all the entities that the customer could have mentioned in the phrase are mentioned. If they said “$50”, the app remembers it in the amount (&lt;strong&gt;var amount: string = "";&lt;/strong&gt;), if the person said something about their account (savings or deposit) or the bank they want to transfer the money to (Wells Fargo, Bank of America, etc - which are already on file in users_db.json), the app remembers that information, as the lines below show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var source_account: string="";
    var target_account: string="";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same logic applies to &lt;strong&gt;var account: string ="";&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Tags &lt;strong&gt;source&lt;/strong&gt; and &lt;strong&gt;target&lt;/strong&gt; are an extra marker of entities, which help differentiate entities’ meaning. &lt;strong&gt;Source&lt;/strong&gt; refers to which account the money will be transferred from and &lt;strong&gt;target&lt;/strong&gt; refers to where the money will be transferred to.&lt;/p&gt;

&lt;p&gt;Lines 105-108 refer to the instance when the &lt;strong&gt;bank&lt;/strong&gt; or &lt;strong&gt;account&lt;/strong&gt; was identified without any tag assigned. For example, if a customer says “transfer $50, savings account”, we don’t yet know whether we should take $50 from the savings account or transfer that amount to the savings account. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/7hFVQmRqHzwA3zPdQVZE9H/c0c02498c2771f7ba20aee711812495f/Account_and_bank.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/7hFVQmRqHzwA3zPdQVZE9H/c0c02498c2771f7ba20aee711812495f/Account_and_bank.jpg" alt="Account and bank"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One more important thing to note is that you shouldn’t worry about the customer asking tangential phrases such as “are you a robot?”, “call me back later”, or “wait a moment”:&lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/3v6cx0SVFGAkMuXybiXqmH/20ecf0c2b1343ffcc85b8dbd77af86f6/commonReactions.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/3v6cx0SVFGAkMuXybiXqmH/20ecf0c2b1343ffcc85b8dbd77af86f6/commonReactions.jpg" alt="commonReactions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, common reactions not only have the “wait” part, but iAmRobot, for instance, which describes the situation when a customer can digress to asking whether the person on the other side of the phone is a robot. You don’t need to worry about digressions such as a customer asking to repeat a question or a statement AI says, as it’s already accounted for.&lt;/p&gt;

&lt;p&gt;Note that the app follows a slot filling system. From lines 186-192 you see that AI will try to get all the information necessary (what bank to transfer money to, from what account to take the funds from, and what amount to transfer) from the customer. It will go in a loop __     loop: goto transfer_money;__ until it has all the information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  transitions
    {
        provide_data: goto transfer_money on #messageHasIntent("transfer_money") or #messageHasData("bank") or #messageHasData("account") or #messageHasData("numberword");
        loop: goto transfer_money;
        confirm: goto transfer_confirmation;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also note that in this particular demo case the app accounts for 2 different users, yet it can account for all the customers that exist in your bank’s database. We can see that from the screenshot below. For this app, we set those two users to have different banks to transfer money to, set one to have both savings and deposit accounts, and  the other to have only a deposit account. Additionally, the app accounts for the customer's balance in order to cancel the transaction in case the customer doesn’t have sufficient funds. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/5gRPFIMuByUJosoD1jS5c0/2520f60a8af536e5fcb789fd5b622ac9/Users.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/5gRPFIMuByUJosoD1jS5c0/2520f60a8af536e5fcb789fd5b622ac9/Users.jpg" alt="Users"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point we got all the information we need from a customer, which are the account they want to transfer money from, the bank account they want to transfer money to, and the amount. The lines 224-258 describe the steps to make AI ask for confirmation. It will repeat all the information received from the customer and if it’s correct (&lt;strong&gt;positive: goto process_transfer on #messageHasIntent("agreement", "positive");&lt;br&gt;
__),&lt;/strong&gt; the app proceeds to transfer the money. If it got something wrong (&lt;strong&gt;negative: goto transfer_money on #messageHasIntent("agreement", "negative");&lt;br&gt;
__),&lt;/strong&gt; it will ask again for the needed information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node transfer_confirmation
{
    do
    {

        #say("ask_transfer_confirmation",
        {
            amount: $amount,
            source_name: $source_account?.name,
            source_num: $source_account?.num,
            target_name: $target_account?.name,
            target_num: $target_account?.num
        }
        );
        wait *;
    }
    transitions
    {
        positive: goto process_transfer on #messageHasIntent("agreement", "positive");
        negative: goto transfer_money on #messageHasIntent("agreement", "negative");
    }
    onexit 
    {
        negative: do {
            set $amount = "";
            set $source_account = null;
            set $target_account = null;
            set digression.transfer_data.amount = "";
            set digression.transfer_data.source_account = "";
            set digression.transfer_data.target_account = "";
            set digression.transfer_data.account = "";
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s go back to lines 194-222 for a moment. &lt;/p&gt;

&lt;p&gt;&lt;a href="//images.ctfassets.net/pzhspng2mvip/Q4QSOs4u4K0JTzNkFTGUL/554667510b4a6d71b54768f204df0716/Digression.jpg" class="article-body-image-wrapper"&gt;&lt;img src="//images.ctfassets.net/pzhspng2mvip/Q4QSOs4u4K0JTzNkFTGUL/554667510b4a6d71b54768f204df0716/Digression.jpg" alt="Digression"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This part describes a situation where a customer decides to change the amount they want to be transferred. The &lt;strong&gt;block&lt;/strong&gt; is a graph analog of subroutines that provides a mechanism for code reuse.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;if&lt;/strong&gt; part describes a situation where a customer says they want to change the transfer amount and say the exact amount they want to change it to. In which case we notify that the amount has been changed and say the new amount.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(#messageHasData("numberword", { value: true })){
           var amount = #messageGetData("numberword", { value: true })[0]?.value??"";
           #sayText("Awesome, I've just changed the transfer amount to " + amount, repeatMode: "ignore");
           return amount;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;else&lt;/strong&gt; part describes a situation where a customer only says they want to change the transfer amount. Here we ask the customer to tell us the amount they want to change to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  else {
            #sayText("What's the amount you want to be transfered?", repeatMode: "ignore");
            wait *;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that &lt;strong&gt;digression&lt;/strong&gt; can happen at any moment of the conversation. For example, a customer could decide to change the amount to be transferred after choosing where to transfer the money to. You can see which phrases will trigger “differentamt” intent in the &lt;strong&gt;data.json&lt;/strong&gt; tab on the left.&lt;/p&gt;

&lt;p&gt;The final step, as mentioned above, is the app concluding the transaction and sending the funds to where the customer specified, lines 247-267 depict that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node process_transfer
{
    do
    {
        #say("wait_for_processing");
        set $result = external transfer_money($amount, $source_account, $target_account);
        if($result)
        {
            #say("transfer_success");
        }
        else
        {
            #say("transfer_failed");
        }
        #disconnect();
        exit;
    }
    transitions
    {
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And done! Great job, you now have your own automated money transfer conversational AI app!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Whether your main goal is to reduce errors of your call center team, scale your business or become more effective in daily operations, automating with Dasha conversational AI is the right next step for your bank. &lt;/p&gt;

&lt;p&gt;Now that you know how to build a money transfer app, you can go on to building more elaborate apps that target your main goals. And don’t worry if you encounter complications or have questions - Dasha AI developer team is always ready to help you out.&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>ai</category>
    </item>
    <item>
      <title>Take your candidate screening to the next level with this conversational AI app</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Tue, 17 Aug 2021 15:52:21 +0000</pubDate>
      <link>https://dev.to/dashaai/take-your-candidate-screening-to-the-next-level-with-this-conversational-ai-app-3k1</link>
      <guid>https://dev.to/dashaai/take-your-candidate-screening-to-the-next-level-with-this-conversational-ai-app-3k1</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://dasha.ai/en-us/blog/ai-candidate-screening-app"&gt;https://dasha.ai/en-us/blog/ai-candidate-screening-app&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This post will focus on creating a conversational AI app that automates HR candidate screening. Automating candidate screening allows companies to hire better candidates, reduce the backlog of interviewees, save time and money. &lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started with Dasha conversational AI
&lt;/h2&gt;

&lt;p&gt;As the first step, join &lt;a href="https://community.dasha.ai/"&gt;Dasha Developer Community&lt;/a&gt;. It will give you access to all the help you may need be it answering your questions or supporting you with conversational AI app creation. &lt;/p&gt;

&lt;p&gt;This is also where you’ll get your API key to use Dasha.&lt;/p&gt;

&lt;p&gt;Now, you need to download the latest versions of VSCode and Node.js. Once done, launch VSCode and download the &lt;a href="https://marketplace.visualstudio.com/items?itemName=dasha-ai.dashastudio&amp;amp;ssr=false"&gt;Dasha Studio&lt;/a&gt; extension, it enables syntax highlight for DSL and has GUI tool for debugging.&lt;/p&gt;

&lt;p&gt;At this point, open the Terminal in VSCode and type the following commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;npm i -g "@dasha.ai/cli"&lt;/code&gt; - this will install Dasha CLI (&lt;a href="https://dasha.ai/en-us/blog/dasha-cli"&gt;command line interface&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm i&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I recorded a demo that showcases how the conversation goes once you launch the conversational AI app. You can take a look at it below or test it yourself by typing &lt;code&gt;npm start 1987654321&lt;/code&gt; (your phone number with the country code) into the Terminal. &lt;/p&gt;

&lt;p&gt;Note that you can always test your conversational AI app by typing npm start chat and converse with the AI in a text form. This will not only help you test the conversational flow but also gauge whether there are any errors in the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/2Glp_HC-VHc"&gt;https://youtu.be/2Glp_HC-VHc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you’ve checked out the conversation, it’s time to get to know the files you’ll be using to create your candidate screening conversational AI app.&lt;br&gt;
We recommend downloading &lt;a href="https://github.com/dasha-samples/blank-slate-app"&gt;Dasha Blank Slate app&lt;/a&gt; source code and use it as a base to write your code. For that, you’ll have to open &lt;strong&gt;main.dsl&lt;/strong&gt; and &lt;strong&gt;data.json&lt;/strong&gt; files and delete everything you see there. This way you’ll be able to start writing your code from scratch while having all the other essential files (for instance, the commonReactions library that has pre-programmed replies so you don’t have to worry about coding those).&lt;/p&gt;

&lt;p&gt;You can also download the source code of this particular candidate screening app &lt;a href="https://github.com/dasha-samples/hr-candidate-screening"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As mentioned above, you’ll be primarily using 2 files to create your conversational AI app:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;main.dsl&lt;/strong&gt; -- this is where you’ll write your DashaScript Language code to create the workflow of your conversational AI app. With Dasha Studio extension on and with the directions in this &lt;a href="https://dasha.ai/en-us/blog/conversational-ai-app-creation-guide"&gt;post&lt;/a&gt;, it’ll be an easy job for you. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;data.json&lt;/strong&gt; -- you will set the &lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;intents&lt;/a&gt; and &lt;a href="https://dasha.ai/en-us/blog/named-entity-recognition"&gt;entities&lt;/a&gt; (AKA NER, AKA Named Entity Recognition) in this file. The neural network will use intents and entities you’ll create to learn.&lt;/p&gt;

&lt;p&gt;Additionally, you will want to use the &lt;strong&gt;index.js&lt;/strong&gt; file to write out external functions. External functions are needed to process data with the SDK. For example, you may need to process data, get access to databases or APIs or use it for any other purposes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;index.js&lt;/strong&gt; -- it’s a NodeJS file that launches the Dasha SDK. Here you’ll be adding any external functions you deem necessary once adapting the code to your company’s needs. One of your candidate screening app’s external functions would be the applicant’s phone number. &lt;/p&gt;

&lt;p&gt;Now that you’re familiar with the files you’ll be using you can get coding!&lt;/p&gt;
&lt;h2&gt;
  
  
  AI in HR: creating your own candidate screening app
&lt;/h2&gt;

&lt;p&gt;Note that while this code is just an example, you can use it as a base, improve it, rewrite the lines, etc. In other words, adapt it to your company’s and job posting’s requirements.&lt;/p&gt;

&lt;p&gt;First, open the main.dsl file and start off by importing the common library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import the commonReactions library so that you don't have to worry about coding the pre-programmed replies
import "commonReactions/all.dsl";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This common library has a variety of &lt;a href="https://dasha.ai/en-us/blog/using-digressions"&gt;digressions&lt;/a&gt; that become handy when it comes to the candidate going off on a tangent. For instance, it’s not uncommon for a person to ask to give him a moment, either to take some time to think or to attend to something that’s happening. Such digressions are essential and make the app more human-like.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;library

digression @wait
{
    conditions { on #messageHasAnyIntent(digression.@wait.triggers)  priority 900; }
    var triggers = ["wait", "wait_for_another_person"];
    var responses: Phrases[] = ["i_will_wait"];
    do
    {
        for (var item in digression.@wait.responses)
        {
            #say(item, repeatMode: "ignore");
        }
        #waitingMode(duration: 60000);
        return;
    }
    transitions
    {
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point I’d like to point your attention to the &lt;code&gt;var responses: Phrases[] = ["i_will_wait"];&lt;/code&gt;. Once a person asks the AI to wait, it’ll respond with one of the phrases that are stored in the &lt;strong&gt;phrasemap.json&lt;/strong&gt; file. This file is useful when it comes to having diversity in AI’s responses. Here’s an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nl"&gt;"i_will_wait"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"random"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Okay, I'll wait"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Sure, I'll wait"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Okay, no problem!"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The phrases that come after &lt;code&gt;#sayText(“&lt;/code&gt; are static. If you need variety in responses, go ahead and use the phrasemap.json file. Here’s more on &lt;a href="https://docs.dasha.ai/en-us/default/natural-language-generation/#phrasemap"&gt;how to use this file&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At this point you’d want to move forward and declare the input and output variables in the context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context
{
// Declare the input variable - phone. It's your candidate's phone number and it will be used at the start of the conversation.  
    input phone: string;
    output new_time: string="";
    output new_day: string="";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Throughout the conversation (depending on which course the conversation takes) we’ll be getting information about the time and day from the candidate, which is why we put these as an &lt;code&gt;output&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For the purposes of this demo, I’ve decided the open position to be for a sales representative at an imaginary JJC Group. &lt;/p&gt;

&lt;p&gt;To start writing your candidate screening conversational AI app for this position, you’ll need to write a &lt;code&gt;start node&lt;/code&gt; named &lt;code&gt;root&lt;/code&gt;. In it, we’ll program the conversational AI app to connect to the candidate’s phone number, make the AI wait for 1 second before saying the welcome message, and write out the welcome message itself. &lt;/p&gt;

&lt;p&gt;In this node, we want to ask the candidate if they have some time to talk to us and move forward based on their availability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;start node root
{
    do
    {
        #connectSafe($phone); // Establishing a safe connection to the candidate's phone
        #waitForSpeech(1000); // Waiting for 1 second to say the welcome message or to let the candidate say something
        #sayText("Hi, my name is Dasha, I'm calling in regard to your application for the sales representative position at JJC Group. I'd like to ask you some questions. Is it a good time to talk?"); // Welcome message
        wait *; // Wating for the hotel guest to reply
    }
    transitions // Here you give directions to which nodes the conversation will go
    {
        will_call_back: goto will_call_back on #messageHasIntent("no");
        education: goto education on #messageHasIntent("yes");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After we get a reply from the candidate, the conversation will either transition to the &lt;code&gt;will_call_back&lt;/code&gt; or the &lt;code&gt;education&lt;/code&gt; node. Let’s take a look at each:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node will_call_back
{
    do
    {
        #sayText("No worries, when may we call you back?");
        wait *;
    }
    transitions
    {
        call_bye: goto call_bye on #messageHasData("time");
    }
}

node call_bye
{
    do
    {
        set $new_time =  #messageGetData("time")[0]?.value??""; // remembers and stores the time to call the candidate back
        #sayText("Got it, I'll call you back on " + $new_time + ". Looking forward to speaking to you soon. Have a nice day!"); 
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In these two nodes, we get information about the time the candidate is available for the call. We store it and will use it to make a call back at the specified time.&lt;/p&gt;

&lt;p&gt;Given the candidate has some time to talk, we go on to ask our first question. In this case, we need to know if the candidate has an education level higher than high school.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node education
{
    do 
    {
        #sayText("Alright, so, let's begin. Could you first tell me what is the highest level of education you have obtained to date?"); //call on phrase "question_1" from the phrasemap
        wait *;
    }
    transitions 
    {
        disqualified: goto disqualified on #messageHasIntent("high_school"); 
        experience_years: goto experience_years on #messageHasIntent("college"); 
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We follow the same logic to ask the candidate additional qualification questions. For the purpose of this demo, we have the following pre screening questions to ask candidates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how many years of experience the candidate has,&lt;/li&gt;
&lt;li&gt;if they have over 2 years of experience with cold calling,&lt;/li&gt;
&lt;li&gt;how they’d rate their own cold calling skills,&lt;/li&gt;
&lt;li&gt;if they are okay with spending hours on the road,&lt;/li&gt;
&lt;li&gt;if they mind frequent business trips,&lt;/li&gt;
&lt;li&gt;if they’ve consistently achieved their sales goals,&lt;/li&gt;
&lt;li&gt;if extra work hours is something they are okay with,&lt;/li&gt;
&lt;li&gt;and if the compensation level we provide is acceptable for them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since writing these (or any other similar questions) will be an easy task for you, I won’t write the code here. You can always open the &lt;a href="https://github.com/dasha-samples/hr-candidate-screening"&gt;repository&lt;/a&gt; to see the full code.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;node education&lt;/code&gt;, we wrote 2 transitions out. Based on the received intents, the conversation would either go to the next question (&lt;code&gt;experience_years&lt;/code&gt;) or trigger candidate disqualification and take the conversation to &lt;code&gt;node disqualified&lt;/code&gt;. Let’s take a look at the latter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node disqualified
{
    do
    {
        #sayText("Thank you so much for letting me know! It saddens me to say that it doesn't match out basic qualification requirements. That being said, we will keep your CV on file and contact you once a matching position appears. Thank you for your time and have a wonderful day! Bye!");
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the candidate can be disqualified at any moment of the pre-screening interview if one of the minimum qualifications isn’t met. &lt;/p&gt;

&lt;p&gt;In the best-case scenario, we get a candidate who is a fit for the position and meets all the requirements for it. Should that happen, the conversational AI app will arrange an in-person interview:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node interview_day
{
    do
    {
        #sayText("Thank you very much for your replies. At this point I would like to invite you to an in-person interview. What day would work best for you?");
        wait *;
    }
    transitions 
    {
       confirm_day: goto confirm_day on #messageHasData("day_of_week");
    }
    onexit
    {
        confirm_day: do 
        {
        set $new_day = #messageGetData("day_of_week")[0]?.value??""; // remembers and stores the preferred day to schedule the interview
        }
    }
}

node confirm_day
{ 
    do 
    { 
        #sayText($new_day + ", you say?");
        wait *;
    }
        transitions
    {
        interview_time: goto interview_time on #messageHasIntent("yes");
        repeat_day: goto repeat_day on #messageHasIntent("no");
    }
}

node repeat_day
{
    do 
    {
        #sayText("Sorry about that, what day would you be able to come for the interview?");
        wait *;
    }
    transitions 
    {
       confirm_day: goto confirm_day on #messageHasData("day_of_week");
    }
    onexit
    {
        confirm_day: do {
        set $new_day = #messageGetData("day_of_week")[0]?.value??"";
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that we’ve already seen a similar type of node layout when we programmed the conversational AI app to register the time to call the candidate back. Also, note that it’s always best to give feedback to the human in form of repeating the data we’ve got from them. That helps fix the errors the moment they occur and fix them right off the bat in a human-like manner. You can see that done under &lt;code&gt;node confirm_day { do #sayText($new_day + ", you say?");&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After we scheduled the interview day and time, we end the conversation with node end_interview:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node end_interview 
{
    do
    {
        #sayText("Wonderful! Um... This concludes our call, I will relay your replies to the hiring manager. Looking forward to seeing you at the interview. Have a fantastic rest of the day. Bye!");
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a candidate screening app that matches the position you’re hiring for
&lt;/h2&gt;

&lt;p&gt;Your company could be looking for a candidate for a position other than a sales representative. However, this app would serve you as a great starting base. &lt;/p&gt;

&lt;p&gt;Start off by getting a list of pre screening questions to ask candidates from the HR department and get the AI to do the work. Such an app would save your company time and money, and let your HR professionals focus on more meaningful tasks.&lt;/p&gt;

&lt;p&gt;This app took me less than 2 hours to create, so try writing one yourself and let the &lt;a href="https://community.dasha.ai/"&gt;Dasha Community&lt;/a&gt; know what you’ve created. We can’t wait to celebrate your success with you!&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>ai</category>
      <category>aiapp</category>
    </item>
    <item>
      <title>Best restaurant online ordering system? Conversational AI! Or how to make pizza ordering easy with AI</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Tue, 10 Aug 2021 19:08:20 +0000</pubDate>
      <link>https://dev.to/dashaai/best-restaurant-online-ordering-system-conversational-ai-or-how-to-make-pizza-ordering-easy-with-ai-f4n</link>
      <guid>https://dev.to/dashaai/best-restaurant-online-ordering-system-conversational-ai-or-how-to-make-pizza-ordering-easy-with-ai-f4n</guid>
      <description>&lt;p&gt;According to &lt;a href="https://www.morganstanley.com/ideas/online-food-delivery-market-expands"&gt;Morgan Stanley’s research&lt;/a&gt;, 47% of restaurant customers prefer to call the restaurant directly to make an order. Phone ordering isn’t declining at the expected rate and phone call automation is one of the biggest reasons why.&lt;/p&gt;

&lt;p&gt;Voice ordering for restaurants is on the rise. Food chains are adopting artificial intelligence as means to cut operational costs, free their staff, and boost customer experience rates. Pizza restaurants are no exception. &lt;br&gt;
Domino’s was the first large pizza chain to take advantage of AI and automated telephone order taking for pizza.&lt;/p&gt;

&lt;p&gt;In this post, we will take a look at why restaurants use AI to automate delivery and takeout orders. We will also go through a tutorial on creating your own conversational AI pizza ordering app.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why you should use an automated restaurant ordering system
&lt;/h2&gt;

&lt;p&gt;Automation redefines customer experience, decreases costs, and increases efficiency. Some restaurants use delivery bots, others use restaurant online ordering systems (app, website). Others use a combination for the best CX. Taking orders is a fraction of restaurant operations. Yet when you take into account that without automating this part you would have to hire someone to be by the phone to take orders and incur costs. Making your existing staff take phone orders prevents them from giving undivided attention to the customers. It also distracts them from other essential tasks. &lt;/p&gt;

&lt;p&gt;A restaurant might decide to resort to third-party food ordering services. Yet statistics show that the preferred method is having your own automated phone ordering system. Why? The answer is quite simple. The survey conducted by Preoday showed that 68% of food and drink professionals pay commission to their restaurant ordering system supplier. Most customers who want to support a restaurant itself rather than a tech supplier order food directly from the restaurant.&lt;/p&gt;

&lt;p&gt;Nowadays, people prefer to order food delivery versus dining in a restaurant. Even more so during the pandemic. Let’s look at some numbers that show how customers think when it comes to ordering food.&lt;/p&gt;

&lt;p&gt;70% of customers call the restaurant directly when making an order, rather than use third-party platforms, as per &lt;a href="https://hospitalitytech.com/70-consumers-prefer-order-direct-restaurants-not-third-party-services"&gt;Hospitality Technology&lt;/a&gt;, since “consumers want restaurants to take their money, not technology suppliers”,&lt;/p&gt;

&lt;p&gt;as per &lt;a href="https://upserve.com/restaurant-insider/online-ordering-statistics/"&gt;Upserve&lt;/a&gt;, once a week 60% of customers order delivery or takeout,&lt;/p&gt;

&lt;p&gt;20% of the customers say they spend more money when ordering delivery, as per &lt;a href="https://www.restaurantbusinessonline.com/consumer-trends/stats-are-consumers-are-upping-restaurant-delivery"&gt;Restaurant Business Online&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since dining in is the least preferred option, Domino’s decided to use AI to automate the restaurant ordering system. The pizza chain created a virtual assistant that incorporates voice recognition. It integrates with nearly every platform available, be it Google Home, Amazon Alexa, smartwatches, and even Ford Sync! Domino’s customers can now literally ask their car to order pizza for them just by giving a simple voice command. &lt;/p&gt;

&lt;p&gt;Now, if Domino’s can create a voice AI pizza ordering assistant, why can’t you? It’s time to create a simple pizza ordering app with Dasha conversational AI as a Service. &lt;/p&gt;
&lt;h2&gt;
  
  
  Building a pizza ordering conversational AI app with Dasha AI
&lt;/h2&gt;

&lt;p&gt;Before you start you can check out this video that shows how exactly the conversation will flow once you're done writing the code: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/fRDlbrMUPyY"&gt;Embedded content: &lt;/a&gt;&lt;a href="https://youtu.be/fRDlbrMUPyY"&gt;https://youtu.be/fRDlbrMUPyY&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now off to the app making process.&lt;/p&gt;

&lt;p&gt;First things first, you should open your “playground”, AKA Visual Studio Code  where the magic will happen. Then, go to Github and download &lt;a href="https://github.com/dasha-samples/dasha-first-app"&gt;Dasha First App&lt;/a&gt; (it’ll serve you as a base to create your pizza ordering AI app). If you don’t know what’s going on and are new to this, I recommend this &lt;a href="https://dasha.ai/en-us/blog/conversational-ai-app-creation-guide"&gt;starting guide&lt;/a&gt;. When done setting everything up, just get back to this post.&lt;/p&gt;

&lt;p&gt;Now you should have your VS Code open with Dasha First App in it. &lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;main.dsl&lt;/strong&gt; and delete everything you see there, as it needs to be empty for you to write your code. Next, go &lt;strong&gt;intents.json&lt;/strong&gt; and change the name to data.json (that will let you have both [entities and intents). If you get confused at any moment, you can go back to Github and download the &lt;a href="https://github.com/arrrgr/take-pizza-order"&gt;pizza ordering app&lt;/a&gt; that already has everything we’re about to go through laid out.&lt;/p&gt;

&lt;p&gt;Go back to your empty &lt;strong&gt;main.dsl&lt;/strong&gt; and start typing the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "commonReactions/all.dsl";

context 
{
    input phone: string;
    food: {[x:string]:string;}[]?=null;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line means that you are importing the common libraries and the part that says &lt;code&gt;context&lt;/code&gt; provides the variables that the app will store and remember (and use during the chat, if needed).&lt;/p&gt;

&lt;p&gt;The next thing to do is to plot the conversation. We will need to have the conversational AI app safely connect to the customer’s phone (&lt;code&gt;#connectSafe($phone);&lt;/code&gt;), wait for 1 second (&lt;code&gt;#waitForSpeech(1000);&lt;/code&gt;), say the introductory phrase, and wait for the response.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;start node root 
{
    do 
    {
        #connectSafe($phone);
        #waitForSpeech(1000);
        #sayText("Hi, this is Yummy Pizza, how may I help you today?");
        wait *;
    }    
    transitions 
    {
        place_order: goto place_order on #messageHasIntent("yes");
        place_order_pizza: goto place_order_pizza on #messageHasIntent("order_pizza");
        no_dice_bye: goto no_dice_bye on #messageHasIntent("no");
    }
}

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

&lt;/div&gt;



&lt;p&gt;The conversation can go multiple ways and we have to account for that right off the bat. To the “how may I help you” question a customer can respond something like:&lt;/p&gt;

&lt;p&gt;I’d like to make an order (&lt;code&gt;place_order&lt;/code&gt;),&lt;br&gt;
I wanna order a pizza (&lt;code&gt;place_order_pizza&lt;/code&gt;),&lt;br&gt;
Sorry, wrong number / changed my mind, sorry, bye (&lt;code&gt;no_dice_bye&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;That’s what our transitions are for. In order for the transitions to work, we have to use &lt;strong&gt;node&lt;/strong&gt;s. Let’s take a look at how that works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node place_order
{
    do 
    {
        #sayText("Got that! What can I get for you today?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasData("food");
    }
    onexit
    {
        confirm_food_order: do {
        set $food = #messageGetData("food");
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We see quite a lot going on in this node. It will serve us in case a customer responds with “I’d like to make an order, please” or similar - you’ll have to write down the intents in the &lt;strong&gt;data.json&lt;/strong&gt; file. That’s how my intents look like for this specific case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"place_order"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want to place an order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want to pick up some food"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"Can I get some food?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"food"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want to place an order for pick up"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to pick up some food"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"can I pick up some food"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to make an order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to order something"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"excludes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to get a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to order a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want to order a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to order a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I would like to order a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want to order a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"yes, I want a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"yes, I'd like to order a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"yes, I'd like to order a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to have a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I want to buy a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I wanna get a pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to get a pizza"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It has &lt;strong&gt;&lt;code&gt;includes&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;excludes&lt;/code&gt;&lt;/strong&gt; parts since I want this specific intent only to be triggered once a customer specifies only that they want to make an order without saying that want pizza (since I’m going to be using a different node for that, we’ll get to that in a bit).&lt;/p&gt;

&lt;p&gt;Now that the conversational AI app recognized the intent, it will ask the customer what they’d like to order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;do 
    {
        #sayText("Got that! What can I get for you today?");
        wait *;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we assume that the customer will say they want pizza since it’s a pizza place they’re calling. You could add other transitions if you’d like. For instance, you could program your conversational AI app to be able to answer questions that might follow this node like “what do you guys have?” or “could you walk me through the menu?”.&lt;/p&gt;

&lt;p&gt;If a customer has a specific pizza in mind, such as a Pepperoni, and answers something along the lines of “I’d like to get a Pepperoni”, the app would remember this piece of information, store it, and transition to the &lt;strong&gt;&lt;code&gt;node confirm_food_order&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node confirm_food_order
{
    do
    {
        #sayText("Perfect. Let me just make sure I got that right. You want ");
        var food = #messageGetData("food");
        for (var item in food)
            {
                #sayText(item.value ?? "and");
            }
        #sayText(" is that right?");
        wait *;
    }
     transitions 
    {
        order_confirmed: goto payment on #messageHasIntent("yes");
        repeat_order: goto repeat_order on #messageHasIntent("no");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;var&lt;/strong&gt; part stands for the variable (remember we put it in the context?). You want to make your conversational AI remember that the customer wanted Pepperoni. In this part, we ask for confirmation that we got the order correctly and then move on to the payment part, more on that later. If the AI didn’t hear the customer properly or misunderstood them, we have to make sure we take the order all over again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node repeat_order
{
    do 
    {
        #sayText("Let's try this again. What can I get for you today?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasData("food");
    }
    onexit
    {
        confirm_food_order: do {
        set $food = #messageGetData("food");
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the AI asks for the order details, we need to once again program it to remember the food item (pizza kind) before moving on to confirming the order once more:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; onexit
    {
        confirm_food_order: do {
        set $food = #messageGetData("food");
       }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let’s say that after the intro in the node root the customer says they want to order pizza, but don’t specify which one exactly they want. We need to create a new node (&lt;code&gt;node place_order_pizza&lt;/code&gt;) for that and ask them to specify what kind of pizza they want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node place_order_pizza
{
    do 
    {
        #sayText("What kind of pizza would you like?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasData("food");
       pizza_kind: goto pizza_kind on #messageHasIntent("pizza_kind");
    }
    onexit
    {
        confirm_food_order: do {
        set $food = #messageGetData("food");
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The customer won’t always know which one they feel like ordering or are unaware of what’s on the menu, so we need to program that part too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node pizza_kind
{
    do 
    {
        #sayText("Umm, we have Pepperoni, Hawaiian, Margherita, Buffalo, Cheese, and Veggie pizza. Which one would you like?");
        wait *;
    }
    transitions 
    {
        confirm_food_order: goto confirm_food_order on #messageHasData("food");
        recommend: goto recommend on #messageHasIntent("unsure");
        no_dice_bye: goto no_dice_bye on #messageHasIntent("changed_mind");
    }
     onexit
    {
        confirm_food_order: do {
               set $food =  #messageGetData("food", { value: true });
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the transition part we have 3 options for customer’s reply:&lt;/p&gt;

&lt;p&gt;I’d like Buffalo and Cheese pizza (&lt;code&gt;confirm_food_order&lt;/code&gt;),&lt;br&gt;
Not sure which one I want, could you recommend something? (&lt;code&gt;unsure&lt;/code&gt;),&lt;br&gt;
You know what, I changed my mind, I don’t want pizza anymore (&lt;code&gt;no_dice_bye&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;For each one of these, we have to write down corresponding intents and nodes. Let’s take a look at the &lt;code&gt;recommend&lt;/code&gt; part:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node recommend
{
    do 
    {
        #sayText("Our most popular one is Pepperoni and I personally love it too. Would you like to try it?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasIntent("yes");
       place_order_pizza: goto place_order_pizza on #messageHasIntent("no");
    }
    onexit
    {
        confirm_food_order: do {
               set $food =  #messageGetData("food", { value: true });
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, we say that the most popular pizza at Yummy Pizza is Pepperoni and recommend ordering it.  If a person agrees, we bring them to our well-known (&lt;code&gt;confirm_food_order&lt;/code&gt;) node. Once again, before leaving this node, we remember the kind of pizza the customer wanted to get. If the customer declines our offer, we ask them what kind of pizza they’d like based on the pizza options they heard from us just before. &lt;/p&gt;

&lt;p&gt;Note that the conversation doesn’t have to have a linear structure (and most likely it won’t), so we need to write down digressions, which can be triggered at any moment of the conversation. For instance, if at any time the customer decided to say “I wanna get a pizza”, it would go directly to the digression we specified, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression place_order_pizza
{
    conditions {on #messageHasIntent("order_pizza");}
    do 
    {
        #sayText("What kind of pizza would you like?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasData("food");
       pizza_kind: goto pizza_kind on #messageHasIntent("pizza_kind");
    }
    onexit
    {
        confirm_food_order: do {
               set $food =  #messageGetData("food", { value: true });
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, it’s pretty much exactly the same as the node with the same name. The only difference here is that in the digression you have to write out the conditions for it to be triggered. In this case, if the app recognizes the intent &lt;strong&gt;order_pizza&lt;/strong&gt;, it’ll trigger this digression and then make a transition to what should follow - confirming the order or walking the customer through the pizza options.&lt;/p&gt;

&lt;p&gt;The same logic applies to other nodes, like &lt;strong&gt;pizza_kind&lt;/strong&gt; and &lt;strong&gt;place_order&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Shall a customer not want to continue the conversation, we need to end it. We do that by writing our &lt;strong&gt;&lt;code&gt;node no_dice_bye&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node no_dice_bye 
{
    do 
    {
        #sayText("Sorry I couldn't help you today. Have a great day. Bye!");
        #disconnect();
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, imagine the customer decides to order something to drink. They can mention it at any moment, so it should be programmed as a digression too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression drinks 
{
    conditions {on #messageHasIntent("drinks");}
    do 
    {
        #sayText("We have vanilla milkshake and soda. Which one would you like?");
        wait *;
    }
    transitions 
    {
        soda: goto soda on #messageHasIntent("soda");
        milkshake: goto milkshake on #messageHasIntent("milkshake");
    }
}

node soda 
{
    do 
    {
        #sayText("Okay, soda it is. I added it to your order. Would that be all?");
        wait *;
    }
transitions 
    {
        payment: goto payment on #messageHasIntent("yes");
        can_help_then: goto can_help_then on #messageHasIntent("no");
    }
}

node milkshake 
{
    do 
    {
        #sayText("Okay, milkshake it is. I added it to your order. Would that be all?");
        wait *;
    }
transitions 
    {
        payment: goto payment on #messageHasIntent("yes");
        can_help_then: goto can_help_then on #messageHasIntent("no");
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We could describe all the drinks your pizza restaurant offers, but in order to not make this code too long, let’s just say we offer soda and vanilla milkshakes and the customer picks one or the other, which will bring us to either &lt;code&gt;node milkshake&lt;/code&gt; or &lt;code&gt;node soda&lt;/code&gt;. Once done, we’ll ask the customer if they’ll be paying at the store. For the purpose of this demo, I decided to not include the option of actual card processing, but you should definitely write it out when writing your own code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node payment
{
    do
    {
        #sayText("Great. Will you be paying at the store?");
        wait *;
    }
     transitions 
    {
        in_store: goto pay_in_store on #messageHasIntent("pay_in_store") or #messageHasIntent("yes");
        by_card: goto by_card on #messageHasIntent("pay_by_card") or #messageHasIntent("no");
    }
}

node pay_in_store
{
    do
    {
        #sayText("Your order will be ready in 15 minutes. Once you’re in the store, head to the pickup counter. Anything else I can help you with? ");
        wait *;
    }
     transitions 
    {
        can_help: goto can_help on #messageHasIntent("yes");
        bye: goto success_bye on #messageHasIntent("no");
    }
}

node by_card
{
    do
    {
        #sayText("I'm sorry, I'm just a demo and can't take your credit card number. If okay, would you please pay in store. Your order will be ready in 15 minutes. Anything else I can help you with? ");
        wait *;
    }
     transitions 
    {
        can_help: goto can_help on #messageHasIntent("yes");
        bye: goto success_bye on #messageHasIntent("no");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the customer wants to ask something or need some other help, we ask how we could help (&lt;strong&gt;&lt;code&gt;node can_help&lt;/code&gt;&lt;/strong&gt;). Otherwise, we end the conversation (&lt;strong&gt;&lt;code&gt;node bye&lt;/code&gt;&lt;/strong&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
node can_help
{
    do
    {
        #sayText("How can I help?");
        wait *;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression bye 
{
    conditions { on #messageHasIntent("bye"); }
    do 
    {
        #sayText("Thanks for your time. Have a great day. Bye!");
        #disconnect();
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We saw the node &lt;code&gt;success_bye&lt;/code&gt; on multiple occasions above. What we need to write in that node is a thank you message and end the conversation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node success_bye 
{
    do 
    {
        #sayText("Thank you so much for your order. Have a great day. Bye!");
        #disconnect();
        exit;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now you have your pizza ordering conversational AI app ready!&lt;/p&gt;

&lt;h2&gt;
  
  
  Summing it up
&lt;/h2&gt;

&lt;p&gt;Numbers don’t lie, people prefer ordering food to be delivered to their doorstep or walk to the restaurant to pick the food up themselves, and dine in the comfort of their own home. With this pizza ordering conversational AI app you can automate the ordering process for your pizza restaurant. &lt;/p&gt;

&lt;p&gt;However, don’t just stop there. This was just a showcase of what your app could do. Try improving it, add more digressions and nodes, as we discussed above. Make this app answer all your customer’s demands, help you reduce costs, and free up your employees!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>vscode</category>
      <category>conversationalai</category>
    </item>
    <item>
      <title>What is conversational AI and what use cases do different industries use it for?</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Fri, 06 Aug 2021 17:29:56 +0000</pubDate>
      <link>https://dev.to/dashaai/what-is-conversational-ai-and-what-use-cases-do-different-industries-use-it-for-1hdm</link>
      <guid>https://dev.to/dashaai/what-is-conversational-ai-and-what-use-cases-do-different-industries-use-it-for-1hdm</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally posted on &lt;a href="https://dasha.ai/en-us/blog/conversational-ai-use-cases"&gt;https://dasha.ai/en-us/blog/conversational-ai-use-cases&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Conversational AI is a set of technologies that let a machine understand what is being said, evaluate what would be a contextually relevant response, and reply in a human-like manner. &lt;/p&gt;

&lt;p&gt;To recognize human speech and be able to talk like a human a set of machine learning (ML), natural language processing (NLP), text-to-speech (TTS), speech-to-text (STT), and &lt;a href="https://dasha.ai/en-us/blog/named-entity-recognition"&gt;named entity recognition&lt;/a&gt; (NER) tools are used.&lt;/p&gt;

&lt;p&gt;The conversational AI global market size is &lt;a href="https://www.marketsandmarkets.com/Market-Reports/conversational-ai-market-49043506.html"&gt;expected&lt;/a&gt; to grow from $4.8b (2020) up to $13.9b by 2025.  Companies across various industries are quickly adopting conversational AI for business-specific purposes.&lt;/p&gt;

&lt;p&gt;Let’s explore what industries use conversational AI and what real-world problems they solve with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chatbot vs conversational AI
&lt;/h2&gt;

&lt;p&gt;Chatbots are based on strictly scripted, limited conversations that use specific keywords. Chatbots are useful when it comes to simple interactions. Conversational AI on the other hand understands the subtleties of human words, intonation, and tone. By using speech recognition, it understands the spoken language of your customers. Natural language processing (NLP) helps it understand and analyze human language, be it written or spoken. Natural language understanding (NLU) helps it understand what the customers need to be done (&lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;intent classification&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Arthur wrote a fantastic &lt;a href="https://dasha.ai/en-us/blog/chatbots-versus-ai"&gt;article&lt;/a&gt; where he goes deep into differentiating chatbots and conversational AI. A highly recommended read!&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of conversational AI
&lt;/h2&gt;

&lt;p&gt;Here are some of the benefits companies get by employing conversational AI:&lt;/p&gt;

&lt;p&gt;Increased productivity and effectiveness&lt;br&gt;
Conversational AI automates repetitive processes, letting employees respond to more complex calls that require human creativeness. &lt;br&gt;
The AI is available to take and make calls 24/7, has no sick days, is able to handle requests and answer questions no worse than a human can. &lt;br&gt;
In a call center environment, for instance, the AI would let the employees advance to sales positions and qualify only the high-quality leads. Conversational AI would do all the preliminary work and qualify all the incoming leads.&lt;/p&gt;

&lt;p&gt;Lower operating costs&lt;br&gt;
Businesses spend &lt;a href="https://www.ibm.com/blogs/watson/2017/10/the-future-of-call-centers-is-shaped-by-ai/"&gt;over $1 trillion&lt;/a&gt; on customer service calls and conversational AI lowers that cost drastically&lt;br&gt;
Conversational AI is able to handle hundreds of calls simultaneously.&lt;br&gt;
Businesses save money on employee’s salaries and training. The AI reduces the number of customer support employees needed while reducing average wait time.&lt;/p&gt;

&lt;p&gt;Increased customer satisfaction and experience&lt;br&gt;
Higher engagement: customers will no longer need to wait for hours for an agent to free up or wait for working hours to start. They can get their issues solved anytime, anywhere. &lt;br&gt;
Conversational AI can augment live agents’ work. The AI can provide all the information gained during the conversation, making the agents solve customer’s issues faster once the call is transferred to them.&lt;br&gt;
Customer satisfaction can be maximized by the AI analyzing what happened in the past conversations. It can predict how the customer would react and what they would say based on the existing data.&lt;/p&gt;

&lt;p&gt;Increased employee satisfaction&lt;br&gt;
Conversational AI helps to reduce employee churn that occurs due to the repetitive nature of the calls. The employees can spend more time handling complex calls. It would give room to increase both hard and soft skills, and build stronger relationships with customers. &lt;br&gt;
Customer support employees handle around 50 calls per day, which is extremely stressful to some. Conversational AI alleviates this problem.&lt;/p&gt;

&lt;p&gt;Let’s now take a look at different industries that use conversational AI to achieve business-specific goals.&lt;/p&gt;

&lt;h2&gt;
  
  
  What industries use conversational voice AI and what use cases do they have?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Conversational AI use cases for the automotive industry
&lt;/h3&gt;

&lt;p&gt;There are two primary ways car companies use conversational AI: vehicle discovery and maintenance and in-car voice assistants. The latter one is getting popular fast. In the United States, 60% of people are inclined to buy a car with an assistant installed. Nearly 130 million people have already tried using one in their car and over 80 million enjoyed using their in-car voice assistant so much that they’re using it constantly. &lt;/p&gt;

&lt;p&gt;Let’s take a look at the two use cases in more detail:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vehicle discovery and maintenance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Conversational AI makes it easy for customers to discover new cars, book test drives, compare different models of cars, and find a car that matches their requirements. Customers can also have the ease of making inquiries about car loans and payment options.&lt;/p&gt;

&lt;p&gt;Automotive industry companies also use conversational AI to automate car check and repair appointments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connected vehicles&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nowadays, cars are smarter than ever. Car manufacturers incorporate conversational AI into cars so that drivers can have a safer and more efficient driving experience. For example, in-car voice assistants can make calls, control smart home devices, shop for products, and book a table at a restaurant.&lt;/p&gt;

&lt;p&gt;It doesn’t stop there, though. In-car voice assistants can control virtually all car functions. Consumers want their in-car assistants to have more than just basic functions. Customers are expecting their assistants to support various areas of life and help control in-car conditions. To name a few, the control conditions within the car include opening and closing of the windows or the trunk, locking/unlocking the doors, help with parking, AC control, and managing car settings in response to time of the day and weather conditions. &lt;/p&gt;

&lt;p&gt;We have created  &lt;a href="https://dasha.ai/en-us/blog/voice-assistant-for-cars"&gt;in-car voice assistant app&lt;/a&gt; as a proof of concept. . &lt;/p&gt;

&lt;h2&gt;
  
  
  Conversational AI for banking industry
&lt;/h2&gt;

&lt;p&gt;Conversational AI is transforming the way banking industry companies retain their customers and gain new ones. It is &lt;a href="https://www.juniperresearch.com/press/chatbots-a-game-changer-for-banking-healthcare"&gt;expected&lt;/a&gt; that 90% of communication between the banks and their customers will happen through a bot. It’s also expected by 2023 that banks will save $7.3B&lt;br&gt;
of the operational by cost bots. These contribute to the wide adoption of AI in the banking sector.&lt;/p&gt;

&lt;p&gt;Here are some of the possible ways banks use AI:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FAQ&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asking a frequently asked question doesn’t require the customer to provide any additional information to prove their identity. This makes this use case one of the simplest ones. Since banks don’t operate on a 24/7 basis and neither do their customer support lines (for the most part), having conversational AI that solves this is a valuable addition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Loan application automation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There’s no more need for a customer to physically be at the bank or wait on the phone for a representative to free up to create a loan application. When integrated with other sources, AI can analyze documents, make notes, and perform data verification. This makes the job of the bank representative easy when it comes to the loan approval process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scheduling an appointment with a bank representative&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It might be tough to get a hold of a bank representative once a customer is at the bank. Scheduling an appointment in advance saves customers’ time and lets them create plans beforehand. Appointment scheduling can be easily automated via a conversational AI app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Payment processing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Customers might need to transfer money from one bank to another or from one account to another at any moment of time. Accounting for such a use case, Dasha AI created a simple app banks can use to &lt;a href="https://dasha.ai/en-us/blog/money-transfer-automation"&gt;automate payment processing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feedback surveys&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Phone feedback surveys used to be expensive, however, with the rise of conversational AI, that’s no longer the case. Phone surveys are proven to be the best channel to get feedback from customers - they have an over 90% response rate on picked up lines. Here’s a simple app that illustrates how to create &lt;a href="https://dasha.ai/en-us/blog/customer-feedback-survey"&gt;customer feedback conversational AI app&lt;/a&gt;    .&lt;/p&gt;

&lt;h2&gt;
  
  
  Conversational AI for healthcare industry
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://www.marketsandmarkets.com/Market-Reports/artificial-intelligence-healthcare-market-54679303.html"&gt;Healthcare Global Forecast&lt;/a&gt; projected that by 2026, the healthcare industry will experience an immense boost in revenue and see improvements in patient health management due to AI adoption. Healthcare companies use AI in myriad different ways: drug discovery, patient care, illness diagnostics, etc. Conversational AI is also on the list:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Appointment scheduling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nurses and administrators are already busy enough tending to the patients, so it’s necessary to free them from easily automatable calls. With Dasha AI it’s easy to make a conversational AI app that lets patients search for doctors and arrange appointments all within one conversational interface. An appointment scheduling app can also ask screening questions since it would provide the doctor with background information prior to the appointment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mental health management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With machine learning techniques, a mental health management conversational AI app can analyze the tone and the speed of the patient’s voice and provide recommendations based on that. It also could be programmed to analyze patterns of a patient’s mood, activities, and overall mental state over time and, if necessary, make appointments with healthcare professionals. For instance, if it recognizes either by speech tone or words that the patient is stressed out, it could suggest a pre-programmed range of meditations or provide a range of relaxation techniques. Such conversational AI apps could be integrated with various sources of health trackers (heart rate, sleep, diet, blood pressure, sugar level) and make recommendations according to those indicators.&lt;/p&gt;

&lt;p&gt;Yet when creating a mental health conversational AI app you should exercise caution. For instance, it’s important not to use such AI to diagnose or treat suicidal patients, as a human with medical education is the right fit.  &lt;/p&gt;

&lt;p&gt;Such a mental health management AI app can be easily created with Dasha conversational AI API and integrated with various services and health trackers to provide further benefits for the patients.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Health plan research and management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Insurance companies employ conversational AI to generate customers out of leads by walking them through existing insurance policies and helping them pick the one that suits their needs. The AI can assess risks based on the customer’s historical data and provide them the best insurance recommendations. Here’s an example of a conversational AI app that lets you &lt;a href="https://dasha.ai/en-us/blog/how-to-qualify-inbound-leads"&gt;qualify leads better and faster&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symptom checkers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This use case encompasses more than simple symptom checking.&lt;/p&gt;

&lt;p&gt;Conversational AI can call patients who are in rehabilitation after surgery to check on their health, ask about their symptoms and suggest some pain-alleviating strategies if needed. Patients can also make a call to ask a pressing health-related question, be it about medication or illness, and be provided with a preliminary diagnosis and referred to a specialist. If conversational AI deems that the symptoms are serious, it can either call emergency services on behalf of the patient or make a strong recommendation to call 911. &lt;/p&gt;

&lt;p&gt;Companies outside of the healthcare industry can make use of conversational AI symptom checkers. For example, a company might want to check their employee’s health status prior to their shift. We’ve created a &lt;a href="https://dasha.ai/en-us/blog/ai-covid-symptom-checker"&gt;conversational AI symptom checker app&lt;/a&gt; that assesses whether a shift worker has any Covid-19 symptoms. In case they do, the AI suggests they stay at home, otherwise, it lets them know they’re expected to come to work.&lt;/p&gt;

&lt;p&gt;If you’re interested in other ways the healthcare industry uses AI, check out &lt;a href="https://dasha.ai/en-us/blog/ai-in-healthcare"&gt;this post&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conversational AI for hospitality industry
&lt;/h2&gt;

&lt;p&gt;Restaurants, hotels, amusement parks, cruises, entertainment, and tour agencies can all use conversational AI. Customer support is the one that can be automated regardless of what the business sector is. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automated hotel operations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hotels, for instance, can automate the room booking process, 24/7 access to information about the hotel, its services, hotel vicinity questions, or other traveling information. When hotels employ conversational AI they can expect rapid growth of their business. The AI helps to increase customer loyalty, as a happy traveling experience starts with having a great place to stay.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automated restaurant operation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Restaurants can have table booking calls automated, making it possible for hosts to focus on welcoming customers. Another possibility is automating food ordering and delivery. We’ve created a simple &lt;a href="https://dasha.ai/en-us/blog/ai-pizza-ordering"&gt;food ordering app&lt;/a&gt; that helps pizza restaurants take orders in a seamless way, you can check the use case here. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conversational AI for logistics industry
&lt;/h2&gt;

&lt;p&gt;To increase customer satisfaction, logistics companies automate the way customers get package delivery updates. One of the best ways to do that is through conversational AI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Delivery status, tracking, and rescheduling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Over 530 million packages are delivered per day by UPS, USPS, and FedEx alone. In order to manage such volume without the risk of losing customers due to overwhelmed customer support, logistics companies use automation.&lt;/p&gt;

&lt;p&gt;The conversational AI can pull the package information from the database once the customer provides a tracking number. From there it can solve virtually any issue customers can have: rescheduling the delivery date and/or time, checking the status of the delivery, check for other deliveries, etc. &lt;/p&gt;

&lt;p&gt;Check out this conversational AI app logistics companies can use to &lt;a href="https://dasha.ai/en-us/blog/ai-package-tracking"&gt;automate package tracking&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conversational AI automation is easy - and mega efficient
&lt;/h2&gt;

&lt;p&gt;While we took a closer look at only a few industries, there are many other ones that find value in using conversational AI. While the use cases are different for all, one remains constant: customer support automation.&lt;/p&gt;

&lt;p&gt;Happy customers mean loyal customers that are ready to support your business financially for a long period of time. That’s why companies are obsessed with having superior customer support. Employing conversational AIl makes companies even more customer-centric. Most of the customers’ inquiries can be solved by AI in a prompt and personalized manner, while more complex ones can be handled by human employees. &lt;/p&gt;

&lt;p&gt;Dasha AI makes automating virtually any process with conversational AI easy, so why don’t you try creating an app yourself? You can start &lt;a href="https://dasha.ai/en-us/blog/build-conversational-AI-app-1"&gt;with this tutorial&lt;/a&gt;. Be sure to join our &lt;a href="https://community.dasha.ai"&gt;developer community&lt;/a&gt; first. &lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>How to build a conversational AI front desk receptionist app for a hotel in just 2 hours</title>
      <dc:creator>Dasha</dc:creator>
      <pubDate>Fri, 06 Aug 2021 10:54:04 +0000</pubDate>
      <link>https://dev.to/dashaai/how-to-build-a-conversational-ai-front-desk-receptionist-app-for-a-hotel-in-just-2-hours-57ao</link>
      <guid>https://dev.to/dashaai/how-to-build-a-conversational-ai-front-desk-receptionist-app-for-a-hotel-in-just-2-hours-57ao</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://dasha.ai/en-us/blog/AI-hotel-front-desk-receptionist"&gt;https://dasha.ai/en-us/blog/AI-hotel-front-desk-receptionist&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Today we’ll build an automated AI receptionist. Know a small business hotel owner? Build this human-like conversational AI app, test it with them and deploy. Hook your friends up, they will probably be so thankful as to give you some free hotel stays. &lt;/p&gt;

&lt;p&gt;The best part is that you’ll build this app in less than 2 hours. The app creation process with Dasha AI is super intuitive, even a non-developer (or a citizen developer like me, who built this app) can do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hotel front desk AI: why are we building this thing?
&lt;/h2&gt;

&lt;p&gt;There is one great reason to automate repetitive customer interactions with conversational AI. It frees up the humans who used to do these tasks to do more meaningful work, increasing the customer experience all around. That being said, I thought it would be fun (and relevant) to build a robust application that can take a hotel guest’s food order, schedule dry cleaning, bring up some necessities, or tell them a bit about the local area. Also, this is a great learning opportunity if you are just starting to write DashaScript and to use the Dasha platform. &lt;/p&gt;

&lt;p&gt;Without further ado, let’s start building the conversational AI app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a conversational AI hotel front desk receptionist
&lt;/h2&gt;

&lt;p&gt;Once you’ve built the AI receptionist, this is how the completed app will perform: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/2Glp_HC-VHc"&gt;Embedded content: &lt;/a&gt;&lt;a href="https://youtu.be/2Glp_HC-VHc"&gt;https://youtu.be/2Glp_HC-VHc&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Prep work for creating an AI front desk receptionist app
&lt;/h3&gt;

&lt;p&gt;Dasha conversational AI platform is used by developers to create human-like conversational workflows. These can be used for voice interfaces for apps, as well as for customer communication, such as in the example today. Conversational AI uses STT (speech to text) to “read” human speech, NLP, and NLU (natural language processing and understanding) to recognize the user’s intent and NLG (natural language generation) and TTS (text to speech) to respond to the user. As a developer, you don’t need to be a data science expert, you get to use all of these technologies as a service of the Dasha Platform. For a deeper dive, take a look at this &lt;a href="https://dasha.ai/en-us/blog/dasha-conversational-ai-as-a-service"&gt;post&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;In the case of the hotel receptionist app, these AI as a Service technologies make the user/customer/hotel guest feel like they are talking to a considerate human receptionist.&lt;/p&gt;

&lt;p&gt;To get started you need to define the conversation flow. There are three parts to it: &lt;br&gt;
Define the perfect world flow(s) - how will the conversation go if the user/customer engages with the receptionist as you want them to;&lt;br&gt;
Define additional/logical extension workflows. In which direction will the conversation need to go, based on some of the interactions; &lt;br&gt;
Define &lt;a href="https://dasha.ai/en-us/blog/using-digressions"&gt;digressions&lt;/a&gt; - ways in which the user may send the AI on a tangent. Digressions are an essential component of a human-like conversation. Digressions can also be used as an integral part of a perfect world conversational flow. For example, if the user can give a dozen different intents that they seek to achieve in the course of the conversation. More on this in the tutorial.&lt;/p&gt;

&lt;p&gt;You can refer to &lt;a href="https://dasha.ai/en-us/blog/build-conversational-AI-app-1"&gt;this article&lt;/a&gt; which takes you through creating a conversational map step-by-step.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2: Your conversational AI workplace setup
&lt;/h3&gt;

&lt;p&gt;You will need VSCode (Visual Studio Code), NPM, and Node.js, latest versions. Next, join &lt;a href="https://community.dasha.ai/"&gt;Dasha developer community&lt;/a&gt; so that you can get your API key and be able to get assistance from our developers at any moment you need. &lt;/p&gt;

&lt;p&gt;To ease your coding process, you’ll need to get the &lt;a href="https://marketplace.visualstudio.com/items?itemName=dasha-ai.dashastudio-beta"&gt;Dasha Studio extension&lt;/a&gt; in VSCode and install Dasha CLI (&lt;a href="https://dasha.ai/en-us/blog/dasha-cli"&gt;command line interface&lt;/a&gt; by typing &lt;code&gt;npm i -g "@dasha.ai/cli"&lt;/code&gt; in the VSCode terminal. For more on Dasha CLI usage, refer to this &lt;a href="https://dasha.ai/en-us/blog/dasha-cli"&gt;post&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;In case you need assistance, ask in our &lt;a href="https://community.dasha.ai/"&gt;developer community&lt;/a&gt;, and here is a &lt;a href="https://dasha.ai/en-us/blog/conversational-ai-app-creation-guide"&gt;step-by-step tutorial&lt;/a&gt; on getting started.&lt;/p&gt;

&lt;p&gt;Now, clone and open a project with this Dasha  &lt;strong&gt;app source code&lt;/strong&gt; &lt;a href=""&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once done with setting everything up you can move on to the coding part itself.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3: Get to know what you’ll use to create an AI front desk receptionist
&lt;/h3&gt;

&lt;p&gt;There are 3 files you’ll need to use to create your conversational AI hotel front desk receptionist: &lt;strong&gt;main.dsl&lt;/strong&gt;, &lt;strong&gt;data.json&lt;/strong&gt;, and &lt;strong&gt;index.js&lt;/strong&gt;. Let’s take a quick look at the functions of these three.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main.dsl&lt;/strong&gt; - this is where you’ll write your DashaScript Language code to create the workflow of your conversational AI app. With Dasha Studio extension on and with the directions in this post, it’ll be an easy job for you.&lt;br&gt;
&lt;strong&gt;Data.json&lt;/strong&gt; - this is where you set the &lt;a href="https://dasha.ai/en-us/blog/intent-classification"&gt;intents&lt;/a&gt; and &lt;a href="https://dasha.ai/en-us/blog/named-entity-recognition"&gt;entities&lt;/a&gt;(AKA NER, AKA Named Entity Recognition). The neural network will use intents and entities you’ll create to learn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Index.js&lt;/strong&gt; - it’s the NodeJS file that launches the Dasha SDK. Here you’ll be adding any external functions you deem necessary once adapting the code to your hotel’s needs. &lt;/p&gt;

&lt;p&gt;Now that that’s off the table, let’s get to the fun part - the coding!&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4: Build your conversational AI app
&lt;/h3&gt;

&lt;p&gt;The first thing to do is to download &lt;a href="https://github.com/dasha-samples/dasha-first-app"&gt;Dasha First App&lt;/a&gt;, which will serve as a base for your code. Once uploaded to VSCode, go to &lt;strong&gt;main.dsl&lt;/strong&gt; and &lt;strong&gt;data.json&lt;/strong&gt;(it could also be called intents.json) and delete everything you see there.&lt;/p&gt;

&lt;p&gt;Now, start off by importing the common libraries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import the commonReactions library so that you don't have to worry about coding the pre-programmed replies
import "commonReactions/all.dsl";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, establish the context your AI hotel front desk receptionist app will use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context
{
// Declare the input variable - phone. It's your hotel room phone number and it will be used at the start of the conversation.  
    input phone: string;
    output new_time: string="";
    output new_day: string="";
// Storage variables. You'll be referring to them across the code.
    food: {[x:string]:string;}[] = [];
    pizza: {[x:string]:string;}[]?=null;
    appetizers: {[x:string]:string;}[]?=null;
    main_dishes: {[x:string]:string;}[]?=null;
    drinks: {[x:string]:string;}[] = [];
    forgotten_thing: {[x:string]:string;}[]=[];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;start node root&lt;/code&gt; serves as a welcome message and a starting point for the phone conversation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// A start node that always has to be written out. Here we provide instructions to the AI app on how to behave once the connection is established. 
start node root
{
    do
    {
        #connectSafe($phone); // Establishing a safe connection to the hotel room's phone.
        #waitForSpeech(1000); // Waiting for 1 second to say the welcome message or to let the hotel guest say something
        #sayText("Hi, this is Butterfly Resort Hotel reception. How may I help you?"); // Welcome message
        wait *; // Waiting for the user to reply
    }
    transitions // Here you give directions to which nodes the conversation will go
    {
        // Transitions could be written out here, in which case you'd need to write out corresponding nodes. Otherwise, the conversation will go to a digression triggered by specific intent. In this case, we are routing the conversation with digressions. 
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, there’s noting under &lt;code&gt;transitions&lt;/code&gt;. That doesn’t mean you don’t need or have to write anything under it. The reason why I left this part blank is that the code is almost entirely based on digressions.&lt;/p&gt;

&lt;p&gt;Digressions in the code exist since it’s human and natural to go off on a tangent and we, as developers of a conversational AI app, have to account for that. Digressions can be triggered at any moment of the conversation and either lead to another digression or a transition to the corresponding node established under &lt;code&gt;transitions&lt;/code&gt;. Let’s take a look at one of the digressions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression cleaning // Digressions can be triggered at any moment of the conversation. 
{
    conditions {on #messageHasIntent("cleaning");} // This digression is triggered when a person says something that is related to the room cleaning service. The intents are written out in the data.json file.
    do // Once this digression is triggered, here's what Dasha AI will do
    {
        #sayText("Absolutely, someone will come up to your room in approximately 10 minutes. Is there anything else I can help you with?");
        wait *; // Waiting for the person to either end the call, proceed to ask more questions, etc. The AI doesn't say anything before hears a human speak.
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that there are no transitions here. The conversation can go to any digression specified in the code at this moment. Now, let’s take a look at a digression that has transitions specified:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression order 
{
    conditions {on #messageHasIntent("order");}
    do
    {
     #sayText("Sure thing. What would you like to order?");
     wait *;
    }
    transitions
    {
        menu: goto menu on #messageHasIntent("menu") or #messageHasIntent("unsure"); // In this case we expect the hotel guest not knowing what's on the hotel restaurant's menu, therefore we will make a transition to the menu node
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There can be as many transitions as you deem necessary. For the purposes of this demo, I’ve only written one - &lt;code&gt;menu&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node menu
{
    // Note that you don't write conditions for nodes (compared to digressions), because a node always has another node (or digression) directly leading into it.
    do    {
        #sayText("We have various appetizers, pizza, main dishes and drinks. What would you like to get?");
        wait *;
    }
    transitions // 4 options of different types of food/drinks. 
    {
        appetizers: goto appetizers on #messageHasIntent("appetizers");
        pizza: goto pizza on #messageHasIntent("pizza");
        main_dishes: goto main_dishes on #messageHasIntent("main_dishes");
        drinks: goto drinks on #messageHasIntent("drinks");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four transitions here. Each of the transitions leads to one of the menu options, depending on what exactly the hotel guest is feeling like eating. &lt;/p&gt;

&lt;p&gt;Now is the perfect time to note that we have &lt;code&gt;#messageHasIntent("drinks")&lt;/code&gt;. The conversation will transfer to the corresponding node in case the guest have said something that triggers the &lt;strong&gt;intent&lt;/strong&gt; &lt;code&gt;“drinks”&lt;/code&gt;. However, very soon we’ll see that we have an &lt;strong&gt;entity&lt;/strong&gt; with the same exact name, but &lt;code&gt;”drinks”&lt;/code&gt; at that time will serve us an entirely different purpose.&lt;/p&gt;

&lt;p&gt;Back to the code. Let’s imagine the guest isn’t too hungry and wants appetizers. That’s what we’re going to write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node appetizers
{
    do 
    {
        #sayText("We've got fried calamari, french fries, spring salad, and a soup of the day. What of these would you like to order?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasData("food"); // We have an entity here - food. It's written out in the data.json file under entities.
    }
     onexit // Specifies an action that Dasha AI should take, as it exits the node. The action must be mapped to a transition
    {
        confirm_food_order: do {
               set $appetizers =  #messageGetData("food", { value: true }); // Dasha AI will remember what has been ordered and will update the "food" variable. "value: true" will return all results that have a value field
       }
    }
}

digression appetizers
{
    conditions {on #messageHasIntent("pizza_kind");}
    do 
    {
        #sayText("We've got fried calamari, french fries, spring salad, and a soup of the day. What of these would you like to order?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasData("food"); 
    }
     onexit
    {
        confirm_food_order: do {
               set $appetizers =  #messageGetData("food", { value: true });
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that there is both a node and a digression here. It’s not impossible that the guest already knows what’s on the menu (maybe he ordered food earlier in the day), and we should account for that.&lt;/p&gt;

&lt;p&gt;After your AI hotel receptionist got the information, it’ll transfer to the &lt;code&gt;confirm_food_order&lt;/code&gt; node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node confirm_food_order
{
    do
    {
        var sentence = "Perfect. Let me just make sure I got that right. You want ";
        set $food = #messageGetData("food");
        for (var item in $food) {
            set sentence = sentence + (item.value ?? " and ");  // In case the guest decides to order multiple items of food
        }
        set sentence = sentence + ". Is that right?";
        #sayText(sentence); 
        wait *;
    }
     transitions 
    {
        order_confirmed: goto order_confirmed on #messageHasIntent("yes");
        repeat_order: goto repeat_order on #messageHasIntent("no");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, we’ve given feedback to the guest explaining that we’ve understood and noted what they want and now should either confirm the order or repeat it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node order_confirmed
{
    do
    {
        #sayText("Your order will be ready in 15 minutes. We'll bring it straight to your room! Anything else I can help you with? ");
        wait *;
    }
     transitions 
    {
        can_help: goto can_help on #messageHasIntent("yes");
        bye: goto bye on #messageHasIntent("no");
    }
}

node repeat_order
{
    do 
    {
        #sayText("Let's try this again. What can I get for you today?");
        wait *;
    }
    transitions 
    {
       confirm_food_order: goto confirm_food_order on #messageHasData("food");
       confirm_drinks: goto confirm_drinks on #messageHasData("drinks");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In case the conversational AI app got the order correctly, we’ll proceed to ask what else we could help the guest with, or end the conversation shall the guest says “bye” or a derivative (again, all written down in the intents part in the data.json file).&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;node repeat_order&lt;/code&gt; it’s best we write out 2 transitions: one going back to confirming food order, another one going back to confirm the drinks order, since &lt;code&gt;drinks&lt;/code&gt; and &lt;code&gt;food&lt;/code&gt; are two separate entities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node drinks
{
    do 
    {
        #sayText("We have orange juice, Sprite, and vanilla milkshakes. What would you like to get?");
        wait *;
    }
    transitions 
    {
       confirm_drinks: goto confirm_drinks on #messageHasData("drinks");
    }
    onexit
    {
        confirm_drinks: do {
        set $drinks = #messageGetData("drinks");
       }
    }
}

digression drinks
{   
    conditions {on #messageHasIntent("drinks");}
    do 
    {
        #sayText("We have orange juice, Sprite, and vanilla milkshakes. What would you like to get?");
        wait *;
    }
    transitions 
    {
       confirm_drinks: goto confirm_drinks on #messageHasData("drinks");
    }
    onexit
    {
        confirm_drinks: do {
        set $drinks = #messageGetData("drinks");
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once again, same as with the food, we want both a node and a digression. &lt;/p&gt;

&lt;p&gt;And finally we see the &lt;code&gt;messageGetData("drinks")&lt;/code&gt;. As mentioned before, this &lt;code&gt;“drinks”&lt;/code&gt; part comes from entities. Let’s take a quick look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nl"&gt;"drinks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"open_set"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"values"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"orange juice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"OJ"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"juice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"orange drink"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vanilla milkshake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"milkshake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vanilla drink"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vanilla one"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Sprite"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"soda"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take a look at the way entities for “food” are written in order to see the difference.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"entities"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"food"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"open_set"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"values"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Pepperoni"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"pepperoni"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pepperoni pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a pepperoni"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"the pepperoni pizza"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Margherita"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Margherita pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a margherita pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a margherita"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"margherita"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Veggie"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"vegan pizza"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vegan"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vegans"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vegeterian"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"with vegetables"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"without meat"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fried calamari"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"calamari"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"the fried calamari"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"the calamari"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"french fries"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"fries"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"the french fries"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"the fries"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;  
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"spring salad"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"the salad"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a salad"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"spring one"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"soup of the day"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"the soup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"soup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"whatever soup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a soup"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mushroom tortellini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"tortellini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"the tortellini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"the mushroom thingy"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"baked honey mustard chicken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"the honey mastard one"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"honey mustard"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"honey one"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"chicken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"baked chicken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"baked honey chicken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"baked mustard chicken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mustard one"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pasta carbonara"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"pasta"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"carbonara"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vietnamise porkchops"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"synonyms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"vietnamese dish"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pork"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"porkchops"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"includes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'd like a (pepperoni)[food] please"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll take a (veggie pizza)[food] now"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll like to get a (margherita)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll like a (margherita)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll have a (Pepperoni)[food] please"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll order the (soup of the day)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll have some (french fries)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll order a (spring salad)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll take (french fries)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll take the (mushroom tortellini)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll get the (muchroom thingy)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll take the (soup)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll take the (honey one)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"I'll take the (huney mastard)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"order the (pasta)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"get a (pasta carbonara)[food]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"take that (vietnamese dish)[food]"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we don’t want to write a new entity for each food item like pizza, appetizers, etc. We’d rather have it all in one place. It’s also important to note that for the app to learn properly, it’s best to write out an &lt;code&gt;”includes”&lt;/code&gt; section, specifying a couple of ways the hotel guest can say his order. &lt;/p&gt;

&lt;p&gt;Now, let’s take a look at another example similar to the &lt;code&gt;“food”&lt;/code&gt; and &lt;code&gt;“drinks”&lt;/code&gt; one. Humans can be forgetful and it’s not uncommon for them to not bring something they need to the hotel. Let’s create a case for this. Here and below please refer to the comments within code body for details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression forgot_sth
{
    conditions {on #messageHasIntent("forgot_sth");}
    do
    {
        #sayText("That happens, don't worry. I'm sure we have whatever you need. What did you forget to bring?");
        wait *;
    }
    transitions
    {
        forgotten_thing: goto forgotten_thing on #messageHasData("forgotten_thing");
    }
}

node forgotten_thing
{
    do
    {
        var sentence = "Okay, we're about to bring  ";
        set $forgotten_thing = #messageGetData("forgotten_thing");
        for (var item in $forgotten_thing) {
            set sentence = sentence + (item.value ?? "and");
            }
        set sentence = sentence + " to you. Did I get that right?";
        #sayText(sentence); 
        wait *;
    }
     transitions 
    {
        confirm_forgotten: goto confirm_forgotten on #messageHasIntent("yes");
        repeat_forgotten: goto repeat_forgotten on #messageHasIntent("no");
    }
}

node confirm_forgotten
{ 
    do 
    { 
        #sayText("We're gonna bring it to to your room in 5 to 10 minutes. May I help with any other questions?");
        wait *;
    }
     transitions
    {
        can_help: goto can_help on #messageHasIntent("yes");
        repeat_forgotten: goto repeat_forgotten on #messageHasIntent("no");
    }
}

node repeat_forgotten
{
    do 
    {
        #sayText("Let's try this again. What was it that we can bring you?");
        wait *;
    }
    transitions 
    {
       forgotten_thing: goto forgotten_thing on #messageHasData("forgotten_thing");
    }
    onexit
    {
        forgotten_thing: do {
        set $forgotten_thing = #messageGetData("forgotten_thing");
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, this follows the same logic as the &lt;code&gt;“food”&lt;/code&gt; and &lt;code&gt;“drinks”&lt;/code&gt; sections. Now it’ll be easy for you to create similar cases that fit your hotel’s and guest’s needs.&lt;/p&gt;

&lt;p&gt;That being said, here are some other cases your conversational AI hotel receptionist is able of solving:&lt;/p&gt;

&lt;h4&gt;
  
  
  Taking a request to take clothes to the dry cleaner shop
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression dry_cleaning
{
    conditions {on #messageHasIntent("dry_cleaning");}
    do
    {
     #sayText("Absolutely, we'll pick your clothes up soon and send it to the dry cleaning service. We'll bring your clothes back to you in 1 day. Is there anything else I can help you with?");
     wait *;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Navigating the hotel guests on what to do and what to see
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression vicinity
{
    conditions {on #messageHasIntent("vicinity");}
    do
    {
     #sayText("There are parks, cinemas, restauntants and an amusement park in the area. What interests you the most at this moment?");
     wait *;
    }
}

digression park
{
    conditions {on #messageHasIntent("park");}
    do
    {
        #sayText("We have two parks nearby: sunrise valley park and oak tree park, both are super beautiful and open twenty four seven. Both are located right outside the hotel within a two minute walking distance. Is there anything else I can tell you about?");
        wait *;
    }
}

digression cinemas
{
    conditions {on #messageHasIntent("cinemas");}
    do
    {
        #sayText("There’s ABA cinema that's located just 5 minutes away to the south of the hotel. It's open from 9 AM to 1 AM. Is there anything else I can tell you about?");
        wait *;
    }
}

digression restaurants
{
    conditions {on #messageHasIntent("restaurants");}
    do
    {
        #sayText("The 2 amazing restaurants around are Kimchi One restaurant, which is open from 9 AM to 9 PM and Bonjorno restaurant, open from 8 AM to 11 PM. Is there anything else I can help with?");
        wait *;
    }
}

digression amusement_park
{
    conditions {on #messageHasIntent("amusement_park");}
    do
    {
        #sayText("There's an amusement park which is within a 15 minute drive. You can take the free shuttle that's located right outside the hotel entrance to get there. But make sure to go there within its working hours, it closes at 4pm these days. Is there anything else I can help with?");
        wait *;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Changing the checkout day
&lt;/h4&gt;

&lt;p&gt;You can make this a date instead of a day. Should that be the case, you’ll need to write down an external function that would be connected to your hotel guest/room scheduling system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node check_out_diff_day
{
    do
    {
        #sayText("What day would you like to check out?");
        wait *;
    }
    transitions 
    {
       new_checkout_day: goto new_checkout_day on #messageHasData("day_of_week");
    }
    onexit
    {
        new_checkout_day: do 
        {
        set $new_day = #messageGetData("day_of_week")[0]?.value??"";
        }
    }
}

digression check_out_diff_day
{
    conditions {on #messageHasIntent("check_out_diff_day");}
    do
    {
        #sayText("What day would you like to check out?");
        wait *;
    }
    transitions 
    {
       new_checkout_day: goto new_checkout_day on #messageHasData("day_of_week");
    }
    onexit
    {
        new_checkout_day: do 
        {
        set $new_day = #messageGetData("day_of_week")[0]?.value??"";
        }
    }
}

node new_checkout_day
{ 
    do 
    { 
        #sayText("Just changed your checkout day to " + $new_day + ". Is that right?");
        wait *;
    }
        transitions
    {
        can_help: goto can_help on #messageHasIntent("yes");
        repeat_new_checkout_day: goto repeat_new_checkout_day on #messageHasIntent("no");
    }
}

node repeat_new_checkout_day
{
    do 
    {
        #sayText("Let's do it one more time. What day would you like to check out?");
        wait *;
    }
    transitions 
    {
       new_checkout_day: goto check_out_diff_day on #messageHasData("day_of_week");
    }
    onexit
    {
        new_checkout_day: do {
        set $new_day = #messageGetData("day_of_week")[0]?.value??"";
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Changing the checkout hour
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node check_out_diff_hour
{
    do
    {
        #sayText("What time would you like to check out?");
        wait *;
    }
    transitions 
    {
       new_checkout_hour: goto new_checkout_hour on #messageHasData("time");
    }
    onexit
    {
        new_checkout_hour: do 
        {
        set $new_time = #messageGetData("time")[0]?.value??"";
        }
    }
}

digression check_out_diff_hour
{
    conditions {on #messageHasIntent("check_out_diff_hour");}
    do
    {
     #sayText("What time would you like to check out?");
     wait *;
    }
    transitions 
    {
       new_checkout_hour: goto new_checkout_hour on #messageHasData("time");
    }
    onexit
    {
        new_checkout_hour: do 
        {
        set $new_time = #messageGetData("time")[0]?.value??"";
        }
    }
}

node new_checkout_hour
{ 
    do 
    { 
        #sayText("You got it. I just changed your checkout time to " + $new_time + ". Did I get that correctly?");
        wait *;
    }
    transitions
    {
        can_help: goto can_help on #messageHasIntent("yes");
        repeat_new_checkout_hour: goto repeat_new_checkout_hour on #messageHasIntent("no");
    }
}

node repeat_new_checkout_hour
{
    do 
    {
        #sayText("Let's do it one more time. What hour would you like to check out?");
        wait *;
    }
    transitions 
    {
       check_out_diff_hour: goto check_out_diff_hour on #messageHasData("time");
    }
    onexit
    {
        check_out_diff_hour: do {
        set $new_time = #messageGetData("time")[0]?.value??"";
       }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Answering questions about the things to do inside of the hotel
&lt;/h4&gt;

&lt;p&gt;Perhaps your hotel has a SPA or/and a swimming pool inside the hotel or somewhere in its vicinity. Nothing is stopping you from writing those nodes and digressions out, make your guests aware of everything you have to offer and make their stay as pleasant as possible :)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;digression hotel_restautant
{
    conditions {on #messageHasIntent("hotel_restautant");}
    do
    {
     #sayText("We do have a restaurant on the first floor. It's open from 7am to 11pm and we're looking forward to seeing you there. May I help with anything else?");
     wait *;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  That’s only the beginning of a wonderful, profitable journey with conversational AI
&lt;/h2&gt;

&lt;p&gt;This app is just a demo. Improve on it, edit it, make it answer the needs of your guests. Create an unforgettable hotel experience for the user so that they want to &lt;strong&gt;only&lt;/strong&gt; choose your hotel as a future place to stay.&lt;/p&gt;

&lt;p&gt;Join &lt;a href="https://community.dasha.ai/"&gt;Dasha Developer Community&lt;/a&gt; for guidance throughout this exciting journey. It’s a great community to meet like-minded developers. &lt;/p&gt;

&lt;p&gt;Thank you and the best of luck! Let me know what you think of this post and this code in the community :) &lt;/p&gt;

</description>
      <category>vscode</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
