<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Katia Gil Guzman on Medium]]></title>
        <description><![CDATA[Stories by Katia Gil Guzman on Medium]]></description>
        <link>https://medium.com/@kagigz?source=rss-eb0a3e13b95e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vFIqIjcR6pJQ6QKGVLb1hg.jpeg</url>
            <title>Stories by Katia Gil Guzman on Medium</title>
            <link>https://medium.com/@kagigz?source=rss-eb0a3e13b95e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 12:02:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kagigz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Turning Your Relational Database into a Graph Database]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/turning-your-relational-database-into-a-graph-database-c4cee3d5c6d2?source=rss-eb0a3e13b95e------2"><img src="https://cdn-images-1.medium.com/max/1200/1*BZiCc5Ea1V4NMRhorYTQXA.jpeg" width="1200"></a></p><p class="medium-feed-snippet">Leveraging LLMs to augment your data</p><p class="medium-feed-link"><a href="https://medium.com/data-science/turning-your-relational-database-into-a-graph-database-c4cee3d5c6d2?source=rss-eb0a3e13b95e------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/turning-your-relational-database-into-a-graph-database-c4cee3d5c6d2?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4cee3d5c6d2</guid>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[hands-on-tutorials]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Sun, 14 Apr 2024 14:27:24 GMT</pubDate>
            <atom:updated>2024-06-19T19:55:06.919Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Getting access to Google APIs for your users with Firebase Auth]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kagigz.medium.com/getting-access-to-google-apis-for-your-users-with-firebase-auth-1b5d63086395?source=rss-eb0a3e13b95e------2"><img src="https://cdn-images-1.medium.com/max/1728/1*rcqLP6uooQvnGHZxRAN2_A.png" width="1728"></a></p><p class="medium-feed-snippet">How to authenticate users on your Firebase app and access google APIs on their behalf with OAuth 2 access tokens</p><p class="medium-feed-link"><a href="https://kagigz.medium.com/getting-access-to-google-apis-for-your-users-with-firebase-auth-1b5d63086395?source=rss-eb0a3e13b95e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kagigz.medium.com/getting-access-to-google-apis-for-your-users-with-firebase-auth-1b5d63086395?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b5d63086395</guid>
            <category><![CDATA[refresh-token]]></category>
            <category><![CDATA[google-api]]></category>
            <category><![CDATA[auth]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[oauth2]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 17:20:35 GMT</pubDate>
            <atom:updated>2023-03-26T17:20:35.994Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From Software Engineer to CTO]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/from-software-engineer-to-cto-c0da5f8d0bfd?source=rss-eb0a3e13b95e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*NbDQDc_aLx5E_7dwAHME0g.jpeg" width="5184"></a></p><p class="medium-feed-snippet">My journey from the corporate to the startup world</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/from-software-engineer-to-cto-c0da5f8d0bfd?source=rss-eb0a3e13b95e------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/from-software-engineer-to-cto-c0da5f8d0bfd?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0da5f8d0bfd</guid>
            <category><![CDATA[work]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[leadership]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Mon, 17 Jan 2022 16:18:52 GMT</pubDate>
            <atom:updated>2022-01-24T16:19:27.726Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Use Azure Queue-Triggered Functions and Why]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/swlh/how-to-use-azure-queue-triggered-functions-and-why-7f651c9d3f8c?source=rss-eb0a3e13b95e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*UsoiCTAgpGfXBHroWuux2A.jpeg" width="2998"></a></p><p class="medium-feed-snippet">A step by step guide on how to process multiple items efficiently</p><p class="medium-feed-link"><a href="https://medium.com/swlh/how-to-use-azure-queue-triggered-functions-and-why-7f651c9d3f8c?source=rss-eb0a3e13b95e------2">Continue reading on The Startup »</a></p></div>]]></description>
            <link>https://medium.com/swlh/how-to-use-azure-queue-triggered-functions-and-why-7f651c9d3f8c?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f651c9d3f8c</guid>
            <category><![CDATA[queue]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-functions]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Mon, 14 Dec 2020 23:58:16 GMT</pubDate>
            <atom:updated>2020-12-15T21:05:50.586Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[UI Design Resources to Kickstart your Project]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://uxplanet.org/ui-design-resources-to-kickstart-your-project-ce2bea7a3740?source=rss-eb0a3e13b95e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*Irl0VYEHYoq4sdaapBT1uw.png" width="2800"></a></p><p class="medium-feed-snippet">A curated list of my go-to tools &amp; libraries</p><p class="medium-feed-link"><a href="https://uxplanet.org/ui-design-resources-to-kickstart-your-project-ce2bea7a3740?source=rss-eb0a3e13b95e------2">Continue reading on UX Planet »</a></p></div>]]></description>
            <link>https://uxplanet.org/ui-design-resources-to-kickstart-your-project-ce2bea7a3740?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce2bea7a3740</guid>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[design-resources]]></category>
            <category><![CDATA[design-tools]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[ux-design]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Mon, 07 Dec 2020 20:45:34 GMT</pubDate>
            <atom:updated>2020-12-07T20:45:34.878Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What I learned during my first year working at Microsoft]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kagigz.medium.com/what-i-learned-during-my-first-year-working-at-microsoft-5a4839342910?source=rss-eb0a3e13b95e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*6RkT10Jrb0MLrAOyl_bcRw.jpeg" width="3000"></a></p><p class="medium-feed-snippet">A fresh eyes&#x2019; perspective on what it takes to be successful at a top tech company</p><p class="medium-feed-link"><a href="https://kagigz.medium.com/what-i-learned-during-my-first-year-working-at-microsoft-5a4839342910?source=rss-eb0a3e13b95e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kagigz.medium.com/what-i-learned-during-my-first-year-working-at-microsoft-5a4839342910?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a4839342910</guid>
            <category><![CDATA[success]]></category>
            <category><![CDATA[workplace]]></category>
            <category><![CDATA[tech-companies]]></category>
            <category><![CDATA[work-advice]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Sun, 08 Sep 2019 00:29:46 GMT</pubDate>
            <atom:updated>2019-09-08T00:29:46.922Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Getting started with Azure Python functions]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kagigz.medium.com/getting-started-with-azure-python-functions-abd4d88706f7?source=rss-eb0a3e13b95e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*V70SYAApNwgzM7pv_j_vnQ.jpeg" width="3000"></a></p><p class="medium-feed-snippet">Learn how to create Azure Python functions with a practical example.</p><p class="medium-feed-link"><a href="https://kagigz.medium.com/getting-started-with-azure-python-functions-abd4d88706f7?source=rss-eb0a3e13b95e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kagigz.medium.com/getting-started-with-azure-python-functions-abd4d88706f7?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/abd4d88706f7</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[functions-as-a-service]]></category>
            <category><![CDATA[azure-functions]]></category>
            <category><![CDATA[python-functions]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 15:32:59 GMT</pubDate>
            <atom:updated>2020-12-13T14:33:32.975Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[End-to-end chatbot creation in node.js with Bot Framework v4 & QnA Maker]]></title>
            <link>https://kagigz.medium.com/end-to-end-chatbot-creation-in-node-js-with-bot-framework-v4-qna-maker-1f3a396a387d?source=rss-eb0a3e13b95e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f3a396a387d</guid>
            <category><![CDATA[qna-maker]]></category>
            <category><![CDATA[microsoft-bot-framework]]></category>
            <category><![CDATA[bot-framework-v4]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[azure-bot-services]]></category>
            <dc:creator><![CDATA[Katia Gil Guzman]]></dc:creator>
            <pubDate>Wed, 06 Feb 2019 14:59:42 GMT</pubDate>
            <atom:updated>2019-02-06T15:37:44.138Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tUcmGhrhJeIPUEKGj4NWTQ.png" /></figure><p><strong>You want to start building chatbots but get lost in documentation, and don’t really know what to look for nor where to start? Well, look no further: this tutorial will teach you how to build a bot end-to-end, using Microsoft’s Bot Framework v4 (node.js) and QnA Maker.</strong></p><p>Read through this, follow the steps, and at the end you will find yourself with a working bot, that you can then publish on your website, messenger, slack… or whichever channel you prefer. All of this can be done in <strong>less than 1 hour</strong>.</p><h3><strong>Intro</strong></h3><p><strong>In this tutorial, we’re going to build a bot which can answer questions. </strong>It can be useful if what you’re looking to do is providing information for users in a direct and simple way, instead of having them search for it.</p><p>If you’re interested in building a bot that can store user data, understand natural language or conduct dialogs, you’ll have to wait a bit for my next tutorials.</p><p>If a simple bot which can answer questions is exactly what you need, then keep on reading!</p><p><strong><em>Note:</em></strong><em> There are several ways of building a bot with Bot Framework v4 and QnA Maker. What is described in this tutorial is what I consider the easiest way.</em></p><p>For this tutorial you will need an Azure account. If you don’t already have one, you can create one for free <a href="https://azure.microsoft.com/en-us/free/">here</a>. You will have to enter your credit card info but don’t worry, an account is free as long as you don’t use paid services — which we won’t do here.</p><h3><strong>Step 1: Creating a QnA Maker service</strong></h3><p><strong>To build this bot, we’re going to use QnA Maker</strong>, which is part of the <a href="https://azure.microsoft.com/en-us/services/cognitive-services">Azure Cognitive Services</a>. This service allows to create – as the name suggests – question and answer bots by providing answers to a set of questions.</p><ul><li>Go to the <a href="https://portal.azure.com/">Azure portal</a> and sign in</li><li>Click on <em>Create a resource</em> (top-left corner)</li><li>Search for <em>QnA Maker</em></li><li>Click on <em>Create</em> (bottom of the page)</li></ul><p>You should now see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*77k8iZzluAPaHgo3Lu7U2w.png" /></figure><ul><li>Choose a unique name and app name (the two can be the same)</li><li>Select your preferred subscription</li><li>Select F0 as the management pricing tier and F as the search pricing tier – unless you want to pay for an unlimited version, but for the purposes of this tutorial the free version is enough</li><li>Create or select an existing resource group</li><li>Choose your preferred location – the one closest to you – for your search and website location (the service itself is only available in West US for now, so you can’t change that)</li><li>Disable App Insights as we won’t need it in this tutorial</li></ul><p>You should now have something similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*YWKMtJxCRAi0xuwRnzDLwQ.png" /></figure><p>Make a note of this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*7CTrQ2CuzpgG9hzczxwpmQ.png" /></figure><p>We will have to come back to it later to make sure everything stays free.</p><p>Finally, click on <em>Create</em> and wait a couple of minutes for everything to be deployed — you will be notified when it’s done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*msRThxST4j27qre_EghQaQ.png" /></figure><p>Now, let’s take a look at what exactly was just deployed.</p><p>Search (at the top of the portal) for the resource group you selected for the creation of the service, to display all the resources it contains.</p><p>4 resources have actually been created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*cNnzaixJTXgbL9wVipT5sA.png" /></figure><ol><li>A QnA Service (one of the Cognitive Services)</li><li>An App Service Plan</li><li>An App Service</li><li>A Search Service</li></ol><p>The App Service is what will host our QnA Service so that it’s accessible through an endpoint, and it relies on an App Service Plan. A Search Service is also used by QnA Maker to search through the content.</p><p>By default, the App Service Plan that was created is on a S1 pricing tier, which is not free, so we have to change that:</p><ul><li>Click on the App Service Plan</li><li>Click on <em>Scale Up</em> under <em>Settings</em> (left menu)</li><li>Click on <em>Dev/Test</em> and select the F1 pricing Tier before clicking on<em> Apply</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*NGh1Yo4zMiCVBukUgK8OWw.png" /></figure><p>After a couple of minutes, if you go into <em>Overview</em>, you should see that the App Service Plan Pricing Tier has changed and is now set to <em>Free: 0 Small</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*8EE_7flQryfsARd-5BOC_g.png" /></figure><h3><strong>Step 2: Linking a knowledge base</strong></h3><p><strong>To store all the information your bot has access to, you will need a QnA Maker knowledge base, that links answers to potential questions.</strong></p><ul><li>Go to <a href="https://www.qnamaker.ai/">qnamaker.ai</a> and sign in</li><li>Click on <em>Create a knowledge base</em></li><li>Go directly to step 2 (we’ve completed what they call step 1 in the first step of this tutorial) and select your tenant, subscription and the QnA service you just created</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*qxA4YZgg7OorQlyyGr4Cbg.png" /></figure><ul><li>Choose a name for your knowledge base (step 3). It doesn’t have to be a unique name, and you can use the same as me: <em>DemoKB</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*TWfSHe6G1LUqR6cDZzd9zg.png" /></figure><ul><li>If you have files containing a set of questions and answers, or a link to a website with an FAQ for example, you can populate your knowledge base with these, but it’s optional</li><li>If you want to have pre-defined questions and answers that will allow your bot to do basic chit-chat, you can choose between 3 personalities. Personally, I’m going for “The Friend”, but feel free to choose whichever you prefer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*Dy4cCKGITfz9Vtf0IUAhKg.png" /></figure><ul><li>Click on <em>Create your KB </em>and wait for a couple of minutes</li></ul><p>After the knowledge base was created, you should be redirected to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*t_LBCp8ZlOhvDjj8d1x44A.png" /></figure><p>With the chit-chat option, our knowledge base is already populated with 97 “QnA pairs”. Pairs are composed of several similar questions and a matching answer.</p><p>You can now add all the QnA pairs you need manually.</p><ul><li>Click on Add QnA pair</li><li>Click on the + sign to add examples of questions users might ask for the same answer — add at least 3 utterances so that your bot has more material to train on</li><li>Add an answer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*Qd2F4y4ju4HpnUb2EfdHgQ.png" /></figure><ul><li>Once you’re finished, click on <em>Save and train</em></li></ul><p><strong>The service will train to recognize the example questions you provided and match them with an answer.</strong> Keep in mind that there’s a whole layer of natural language processing underneath, so that even with a few utterances your bot can recognize similar questions and determine what the user is the most likely to have asked. So even if the user says something that doesn’t match exactly one of your example questions, QnA Maker will still find the matching answer.</p><p>After the service is trained, you can test it:</p><ul><li>Click on Test</li><li>Ask questions and look at the answers (try and make spelling and syntax errors to see how it affects comprehension)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*YdDcMb6_MAWj2Lhkrn3oAA.png" /></figure><p>If you click on <em>Inspect</em>, you can see the confidence score with which an answer was matched to the question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*cARgccmBaVjVRWySLaitCw.png" /></figure><p>If the behavior isn’t what you expected, you can add alternative phrasing to improve the performance.</p><p>When you’re satisfied, click on <em>Publish</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*kOhNl-HO3yzmNh4W_I64aQ.png" /></figure><p>Click again on the <em>Publish</em> button, et voilà! <strong>Your knowledge base is now accessible to the whole internet.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*riS-JXJfP4RdQMoZCLcApA.png" /></figure><p>Make a note of your knowledge base ID, your hostname, and your endpoint key, we are going to need them later. You can find them in the example HTTP request QnA Maker gives you:</p><pre>POST /knowledgebases/<strong>&lt;kbID&gt;</strong>/generateAnswer<br>Host: <strong>&lt;hostName&gt;</strong>/qnamaker<br>Authorization: EndpointKey <strong>&lt;endpointKey&gt;<br></strong>Content-Type: application/json<br>{&quot;question&quot;:&quot;&lt;Your question&gt;&quot;}</pre><h3><strong>Step 3: Creating the bot</strong></h3><p><strong>Now that our QnA Service is ready, we can create the actual bot, which will handle the conversation and use the QnA Service to match answers to user input.</strong></p><p>To host the bot, we need to create a web app.</p><ul><li>Go back to the Azure portal</li><li>Click on Create a resource</li><li>Search for <em>Web App Bot</em></li><li>Click on the <em>Create</em> button</li></ul><p>You should see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*5jvXqfw89s0p8P_C6WN28Q.png" /></figure><ul><li>Choose a unique name for your bot and your app</li><li>Select your subscription, resource group (you can choose the same as for your QnA Maker Service) and your preferred location</li><li>Select the F0 pricing tier</li><li>Click on the bot template area to change the template</li><li>In the panel that has opened, select the v4 version of the SDK, node.js as the language and the Echo Bot template, then confirm by clicking the <em>Select</em> button</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*_LVgzgJU9rT9OF2LGGDw4g.png" /></figure><p>The Basic Bot template includes LUIS, another Cognitive Service, which we won’t cover in this tutorial. The template we’ll use here generates a bot that will simply echo what the users says, but we will make modifications to it and add our QnA Maker service.</p><ul><li>Back in the Web App Bot creation panel, select the App Service Plan that was created with your QnA Maker service</li><li>For the Azure Storage, leave the <em>Create New</em> option selected</li><li>Turn off Application Insights, we won’t use it in this tutorial</li><li>When you’re done, click on <em>Create</em></li></ul><p>Wait for the deployment to complete (it usually takes about 5 minutes), you will be notified when it’s done.</p><p>If we go into our resource group, we can see that 3 new resources have been added:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*2SSCBTKEEsO21j9jTjhUFA.png" /></figure><ol><li>The Web App Bot which will contain our bot logic</li><li>A new App Service which will host our bot and make it accessible through an endpoint</li><li>A Storage Account which can be used to store information</li></ol><h3><strong>Step 4: Setting up the bot development environment</strong></h3><p><strong>To customize the bot template and have our bot do exactly what we want it to, we’ll have to modify the source code. And in order to do that, we need to set up a development environment.</strong> Once you have done this once, you don’t have to do it again when developing other bots.</p><p>I won’t get into details about how to install all the tools for each OS but it’s pretty straightforward, you can just follow the links.</p><ul><li>Install the latest release of the <a href="https://github.com/Microsoft/BotFramework-Emulator/releases">Bot Framework Emulator</a></li><li>Install <a href="https://nodejs.org/en/download/">node.js</a></li><li>Install the <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest">Azure CLI</a></li><li>Install msbot by opening a terminal and running the command:</li></ul><pre>npm install -g msbot</pre><ul><li>If you don’t already have a code editor on your computer, download <a href="https://code.visualstudio.com/">VS Code</a></li></ul><p>Now let’s test our bot locally.</p><ul><li>Go back to the Azure portal and find your web app bot resource: go to the resource group and click on the web app bot name, or directly search for it in the search field at the top of the page</li><li>Click on <em>Build</em> in the left menu, under <em>Bot Management</em></li><li>Click on the <em>Download source code </em>button</li><li>Once your source code is downloaded, unzip it and open your bot’s folder in your preferred code editor</li><li>Create a new file at the root of the folder named “.env”</li><li>Go back to your web app bot resource on Azure</li><li>Go to <em>Application Settings </em>in the left menu under <em>App Service Settings</em></li><li>Scroll down to find the <em>botFilePath</em> and <em>botFileSecret</em> values</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*NcmKDbJePFoxWSpRruEb5Q.png" /></figure><ul><li>Write the following in the .env file:</li></ul><pre>botFilePath=./your_bot_name.bot<br>botFileSecret=&quot;&quot;</pre><p>(replace the value of the <em>botFilePath</em> by the one you found in your bot’s App Settings)</p><ul><li>Go to your bot’s folder, open a terminal (on Windows: Shift + Right Click + <em>Open Powershell window here</em>) and run the command to install restify and botbuilder-ai (our bot app needs this to run properly):</li></ul><pre>npm install --save restify botbuilder-ai</pre><p>By default, the .bot file, that we need to modify, is encrypted. To de-encrypt it, run the following command (still in the bot’s folder):</p><pre>msbot secret -b YOUR_BOT_NAME.bot --secret &quot;YOUR_SECRET&quot; --clear</pre><p>where YOUR_BOT_NAME.bot is the name of your .bot file, and YOUR_SECRET is the <em>botFileSecret</em> you got from the Application Settings.</p><p>You should get the following as a result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*oZLko3LlheTorEcVaEZ-ng.png" /></figure><p>You can now run the bot with this command:</p><pre>node .\index.js</pre><p>If there are no issues, you’ll see this — otherwise, go through the previous steps again and make sure everything is in order:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*pW0nKMw-F3kZ3WHeMoa8-g.png" /></figure><p>Now that your bot is running, you can test it using the Bot Framework Emulator:</p><ul><li>Open the Bot Framework Emulator</li><li>Click on the <em>Open Bot</em> button</li><li>Find your bot’s folder and open the .bot file</li></ul><p>You should now be looking at this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*t5ccH7cJIC29WLTHH--ngA.png" /></figure><p>If you try talking to the bot, as it is the Echo Bot template that we haven’t modified yet, you get this kind of answers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*wSjes5NkKinQ3T7VWwkqrQ.png" /></figure><h3><strong>Step 5: Building the bot logic</strong></h3><p><strong>To change the behavior of our bot and connect it to our QnA service, we need to change its source code.</strong> It’s now time to look at what it is made of and make our modifications!</p><ul><li>Go back to the code editor with your bot’s folder opened and open the .bot file</li><li>Add this code at the end of the services block, right before the closing square bracket</li></ul><pre>,{<br>&#39;type&#39;: &#39;qna&#39;,<br>&#39;name&#39;: &#39;DemoKB&#39;,<br>&#39;kbId&#39;: &#39;YOUR_KBID&#39;,<br>&#39;subscriptionKey&#39;: &#39;YOUR_SUBSCRIPTION_KEY&#39;,<br>&#39;endpointKey&#39;: &#39;YOUR_ENDPOINT_KEY&#39;,<br>&#39;hostname&#39;: &#39;YOUR_HOSTNAME&#39;,<br>&#39;id&#39;: &#39;117&#39;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*tCHqcbd1ahAa0L_Exjkj5g.png" /></figure><p>To find your subscription key:</p><ul><li>Go to the Azure portal and search for your QnA Maker service</li><li>Click on <em>Keys</em> in the left menu under <em>Resource Management</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*eCWXkT1dCx3hW_L7MZ2q8Q.png" /></figure><ul><li>You can use either <em>Key 1</em> or <em>Key 2</em> as your subscription key</li></ul><p>You should have your<em> kbId</em>, <em>endpoint key</em> and <em>hostname</em> from the 2nd step of this tutorial. The name of your knowledge base is what you put as name when you created it — if you’ve done the same as me, it is “DemoKB”.</p><p>Now that we’ve added the reference to our QnA Maker service, we’ll modify the code to access it.</p><ul><li>Open the <em>index.js</em> file and after the line…</li></ul><pre>const BOT_CONFIGURATION = (process.env.NODE_ENV || DEV_ENVIRONMENT);</pre><p>… add the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aad4d376d7436e8461a535a5ca046a16/href">https://medium.com/media/aad4d376d7436e8461a535a5ca046a16/href</a></iframe><ul><li>Replace ‘&lt;YOUR_KB_NAME&gt;’ with the name of your knowledge base (<em>DemoKB </em>if you chose the same as me)</li><li>Replace <em>EchoBot</em> by <em>QnAMakerBot</em> at the following line:</li></ul><pre>const { EchoBot } = require(&#39;./bot&#39;);</pre><ul><li>Delete this line…</li></ul><pre>const bot = new EchoBot(conversationState);</pre><p>… as well as this one:</p><pre>const endpointConfig = botConfig.findServiceByNameOrId(BOT_CONFIGURATION);</pre><ul><li>Open the<em> bot.js </em>file and replace everything with this:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d27debb1565deaadaedec0206b590672/href">https://medium.com/media/d27debb1565deaadaedec0206b590672/href</a></iframe><p>(<strong>Source:</strong> <a href="https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-qna?view=azure-bot-service-4.0&amp;tabs=js">QnA Maker documentation</a>)</p><p>Save, and test your bot by opening the .bot file in the Emulator, after running the node .\index.js command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*zSyRsAUKJeGxNPQRNwF-YA.png" /></figure><p>If you want to change the welcome message, find this line in <em>bot.js</em></p><pre>await turnContext.sendActivity(&#39;Welcome to the QnA Maker sample! Ask me a question and I will try to answer it.&#39;);</pre><p>and change the text.</p><p>You can also change the default message when no matching answer is found at this line:</p><pre>await turnContext.sendActivity(&#39;No QnA Maker answers were found. This example uses a QnA Maker Knowledge Base that focuses on smart light bulbs. To see QnA Maker in action, ask the bot questions like &quot;Why won\&#39;t it turn on?&quot; or &quot;I need help.&quot;&#39;);</pre><h3><strong>Step 6: Deploying the bot to Azure</strong></h3><p><strong>Now that our bot is ready and that we’ve tested it locally, we can deploy it back to Azure.</strong></p><p>First thing we are going to do is re-encrypt our .bot file, so that no one can access the precious information it contains (we don’t want our bot to be used by someone else, do we?)</p><p>Still in your bot’s folder, run the command:</p><pre>msbot secret --new</pre><p>You’ll get a message like this one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*25oH4LmT9Fjvey0zUnxlcg.png" /></figure><p>Copy the secret that was generated (/!\ very important, otherwise you won’t be able to do anything with your bot) and paste it in the <em>.env</em> file as your new <em>botFileSecret</em>, then save.</p><p>To make sure that it works, start your bot again (node .\index.js) and test it in the Emulator.</p><p>Now, we’re going to use the Azure CLI to deploy it to Azure.</p><p>Connect to your Azure subscription with the login command:</p><pre>az login</pre><p>(this will redirect you to your browser to enter your Azure credentials)</p><p>Then set your subscription:</p><pre>az account set --subscription &quot;&lt;subscriptionID&gt;&quot;</pre><p>You can find your Subscription ID by going to the Azure portal, searching for your Azure subscription (with the search field or All Services &gt; Subscriptions) — mine is called “Pass Azure” for example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*X7zE3kDtRm03oep_FTjt6A.png" /></figure><p>The Subscription ID is displayed in the <em>Overview </em>tab.</p><p>You can now publish your bot with the following command:</p><pre>az bot publish --name &lt;bot-resource-name&gt; --resource-group &lt;resource-group-name&gt; --code-dir &#39;.&#39; --verbose</pre><p>&lt;bot-resource-name&gt; is the name of your bot (the name of your .bot file is <em>&lt;bot-resource-name&gt;.bot</em>), and<em> </em>&lt;resource-group-name&gt; the name of the Resource Group you selected during the creation of your web app bot.</p><p>You should get the following success message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*tdmjMw-U_yuL9QT82qzLcQ.png" /></figure><p>To make sure your bot was deployed correctly, you can go to the Azure portal, find your web app bot resource and test it directly from the portal. But first, find the <em>Application Settings </em>of your web app bot, scroll down and update your <em>botFileSecret</em> with the new one. Then, click on <em>Test in web chat </em>in the menu, under <em>Bot Management,</em> and try chatting with your bot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*2Nl5ixoaJde9xJwDrl54rA.png" /></figure><p><strong>And… It’s done! You’re finished with the creation of your bot. </strong>The best part is that you can now update your QnA service directly from the QnA Maker portal directly and not touch the code again.</p><h3><strong>Next step: Publishing to various channels</strong></h3><p>You can now publish your bot to several channels and make it available to end users. Since there are different ways to publish depending on the channel, this part will be covered in separate tutorials.</p><p>But whichever channel you choose, it all starts in the <em>Channels</em> tab, in the menu of your web app bot, under <em>Bot Management.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*QH9VxYy4fSTp8gKoERXYWw.png" /></figure><p>I will update this post regularly and add links to tutorials explaining how to publish to some of these channels. In the meantime, you can take a look at the <a href="https://docs.microsoft.com/en-us/azure/bot-service/bot-service-manage-channels?view=azure-bot-service-4.0">documentation</a>.</p><p>Download the source code directly: <a href="https://github.com/Kagigz/botResourcesJS/tree/master/qnamaker">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f3a396a387d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>