<?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 Omar Miatello on Medium]]></title>
        <description><![CDATA[Stories by Omar Miatello on Medium]]></description>
        <link>https://medium.com/@jackl85?source=rss-3f1cdfeb7721------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6jA7NRbHkjjbq5YusryB-Q.jpeg</url>
            <title>Stories by Omar Miatello on Medium</title>
            <link>https://medium.com/@jackl85?source=rss-3f1cdfeb7721------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:23:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jackl85/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[Assistant & … Pizza  — Tips & Tricks — Part 5]]></title>
            <link>https://medium.com/@jackl85/assistant-pizza-tips-tricks-part-5-3fb7f7820224?source=rss-3f1cdfeb7721------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fb7f7820224</guid>
            <category><![CDATA[dialogflow]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[actions-on-google]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Omar Miatello]]></dc:creator>
            <pubDate>Tue, 17 Mar 2020 10:52:45 GMT</pubDate>
            <atom:updated>2020-03-17T10:52:45.118Z</atom:updated>
            <content:encoded><![CDATA[<h3>Assistant &amp; … Pizza 🍕 — Tips &amp; Tricks — Part 5</h3><h4>Build Actions on Google Assistant with Kotlin! — Utility in Kotlin</h4><blockquote>This article is part of a series “Build Actions on Google Assistant with Kotlin!”<br><a href="https://medium.com/@jackl85/assistant-pizza-overview-part-1-7233ca547e87">Overview</a> | <a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc">Dialogflow</a> | <a href="https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161">Intent</a> | <a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044">Backend</a> | <a href="https://medium.com/@jackl85/assistant-pizza-tips-tricks-part-5-3fb7f7820224"><strong>Tips &amp; Tricks</strong></a></blockquote><h3>Previously on Incredible Amazing Pizza!</h3><p>We want to help the customers of our imaginary “<strong>Incredible Amazing Pizza</strong>” restaurant, we <a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044">create and manage the intent </a><a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044">Ask Ingredients</a> to respond to “What’s a Margherita like?”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gnmBKem7UEMtCKbc74xTXQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*krouyFeUFea9t1Sg9N8irQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bo4272GRb6PLz6BComkgOw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ibP3eKW8QS_GGVYK5z2URQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jg4HWM8zOLP3JOPTzFjmA.jpeg" /><figcaption>Pizza Bufalina @ <a href="https://goo.gl/maps/tKys3MhB5Uf8V13x5">Pizzeria AP — La Pizza Speciale (Castellanza VA, Italy)</a></figcaption></figure><p>Now a few tips to improve our Action.</p><h3>Final tips</h3><h4>Tip #1: Test on your device</h4><p>Open the <a href="https://console.actions.google.com/">Actions on Google console</a>, after the first test on the website, you can test your Action with Google Assistant on your device.<br><em>NOTE: The device </em><strong><em>needs to be logged</em></strong><em> with the same Google Account</em>.</p><p>Just try, talk to your smartphone (or Google Home) and say: “Ok Google, talk to Incredible Amazing Pizza”.</p><p>It should work! 😁</p><h4>Tip #2: Let’s make a good impression, handle the first visit!</h4><p>You should handle differently the first visit and the following.</p><p>In the first visit, it’s important to <strong>show what the user can do with your Action</strong>, but from the second visit, it could be annoying.</p><p>After the first time, you can move faster and just say “welcome back” as if you remember that it is not the first visit.</p><blockquote>Remember: repeat the same information can become frustrating to more experienced users. <a href="https://designguidelines.withgoogle.com/conversation/conversational-components/greetings.html#greetings-tapering">https://designguidelines.withgoogle.com/conversation/conversational-components/greetings.html#greetings-tapering</a></blockquote><p>You can use request.user.isFirstAccess to handle the first visit.</p><pre>inline val User?.<em>isFirstAccess </em>get() = this?.<em>lastSeen </em>== null</pre><blockquote>In this example, I defined isFirstAccess as <a href="https://kotlinlang.org/docs/reference/extensions.html#extension-properties">Kotlin Extension property</a></blockquote><h4>Tip #3: Add support for multiple languages!</h4><p>You can support multiple languages using the resources folder.</p><p>Define a string (for example bye), add the translation in resource_en_US.properties and in the other supported languages.</p><p>In your code add: response.addSimpleResponse(getString(&quot;bye&quot;)) to obtain the string translated for the current user.</p><p>Add resources_it_IT.properties in src/main/resources folder to support the Italian language! 🇮🇹</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*Tc_pV6A9i70Vqto6RlNPMg.png" /></figure><h4>Tip #4: Add intent: Feedback</h4><p>Add an intent to obtain user feedback. It’s useful to improve your Action.</p><h4>Tip #5: Add intent: Bye</h4><p>The user can always terminate the conversation with “stop” or “cancel” command, but that’s not nice.</p><p>Try to understand the right moment, usually when the user request is completed use .endConversation() to close the conversation.</p><p>Create a “bye” intent that could be triggered with: “ok, bye”, “stop”, “cancel”, “bye-bye”, “ok, thanks”, and so on …</p><h4>Tip #6: Kotlin Template based on AoG example</h4><p>Use my template, it’s based on the official <a href="https://github.com/actions-on-google/actions-on-google-java">Action on Google example</a>, and use Kotlin extensions to simplify the development of your Action.</p><p>You can always read the source code here:</p><p><a href="https://github.com/omarmiatello/dialogflow-appengine-kotlin/tree/master/src/main/kotlin/com/github/omarmiatello/actions">omarmiatello/dialogflow-appengine-kotlin</a></p><h3>Mission completed! 🎉</h3><p>You have your first Action, ready to be deployed for everyone or a few friends :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fb7f7820224" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assistant & … Pizza  — Backend — Part 4]]></title>
            <link>https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044?source=rss-3f1cdfeb7721------2</link>
            <guid isPermaLink="false">https://medium.com/p/e914a3a8d044</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[dialogflow]]></category>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[actions-on-google]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Omar Miatello]]></dc:creator>
            <pubDate>Tue, 17 Mar 2020 10:41:00 GMT</pubDate>
            <atom:updated>2020-03-17T13:12:18.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ibP3eKW8QS_GGVYK5z2URQ.jpeg" /><figcaption>Pizza Provolone @ <a href="https://goo.gl/maps/HmoJEbrggY7gjX5y6">Pizzeria Riva Café (Como, Italy)</a></figcaption></figure><h3>Assistant &amp; … Pizza 🍕 — Backend — Part 4</h3><h4>Build Actions on Google Assistant with Kotlin! — Your custom response, written in Kotlin</h4><blockquote>This article is part of a series “Build Actions on Google Assistant with Kotlin!”<br><a href="https://medium.com/@jackl85/assistant-pizza-overview-part-1-7233ca547e87">Overview</a> | <a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc">Dialogflow</a> | <a href="https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161">Intent</a> | <a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044"><strong>Backend</strong></a> | <a href="https://medium.com/@jackl85/assistant-pizza-tips-tricks-part-5-3fb7f7820224">Tips &amp; Tricks</a></blockquote><p>If we want to help the customers of our imaginary “<strong>Incredible Amazing Pizza</strong>” restaurant, we need to respond to the question “What’s a Margherita like?”.<br>In the previous article, we <a href="https://medium.com/@jackl85/build-actions-on-google-assistant-with-kotlin-intent-part-3-cb963c45d161">create the intent </a><a href="https://medium.com/@jackl85/build-actions-on-google-assistant-with-kotlin-intent-part-3-cb963c45d161">Ask Ingredients with the parameter </a><a href="https://medium.com/@jackl85/build-actions-on-google-assistant-with-kotlin-intent-part-3-cb963c45d161">PizzaName</a>.</p><p>Now we should create a service to handle this <em>intent</em>.</p><h3>Our backend as Fulfillment</h3><p>This request needs to be handled by a backend service, I choose <strong>Google App Engine</strong> because it’s a <strong>free service</strong> (with <a href="https://cloud.google.com/appengine/quotas">quotas</a>) and <em>does not require a credit card</em> (it’s very useful for codelabs).</p><p>So, let’s start with App Engine! 🎉</p><h4>Create an App Engine project</h4><p>App Engine is a platform for developing and hosting web applications in Google-managed data centers and is free, up to a certain level of consumed resources.</p><p>To create an App Engine project follow those steps:</p><ul><li>Open <a href="https://console.cloud.google.com/projectselector/appengine">https://console.cloud.google.com/projectselector/appengine</a></li><li>Accept “Terms &amp; conditions”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrhaGx0kpNjp3wFMu6UOTQ.png" /></figure><ul><li>Choose our project in: Select a project</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U-PGfsKDvzj1Ik27OY4P5w.png" /></figure><ul><li>Press on “Create Application” and choose a region</li><li>After that, you can “<strong>Enable billing</strong>” or <strong>just skip it for now</strong>, and press “Cancel”</li><li>You should read: “Your App Engine application has been created”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRnVbTaEJV6I8pcb6wXR7g.png" /></figure><h4>Create a Kotlin project</h4><p>I’m an Android developer and I use Kotlin daily for app development. I tried Kotlin also on the back-end side and it’s a very versatile and powerful language.</p><p>The initial setup requires a few steps:</p><ul><li>Install: <a href="https://www.jetbrains.com/idea/download/"><strong>IntelliJ Community Edition</strong></a> (or <a href="https://developer.android.com/studio"><strong>Android Studio</strong></a>)</li><li>Install: <strong>gcloud CLI</strong> for Windows/Linux/Mac from <a href="https://cloud.google.com/sdk/docs/">https://cloud.google.com/sdk/docs</a> or alternative for Mac OS: brew cask install google-cloud-sdk (read more <a href="http://macappstore.org/google-cloud-sdk/">http://macappstore.org/google-cloud-sdk</a>)</li><li>Open terminal and run: gcloud components install app-engine-java</li><li>Open <a href="https://github.com/omarmiatello/dialogflow-appengine-kotlin">https://github.com/omarmiatello/dialogflow-appengine-kotlin</a> and choose “Use this template” to create a new project (you should be logged on GitHub)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-kWRYfyA14wfHnNs9ZaRjA.png" /></figure><ul><li>Choose a name for your new repository, for example, dialogflow-pizza</li><li>After creating the repo, choose “Clone or download” and copy the web URL</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0YMC9mFvlvKi2Ug7nE-1hA.png" /></figure><ul><li>Open IntelliJ (or Android Studio), choose “Check out from Version Control” and paste our URL</li><li>Open src/main/kotlin/***/MyActionsApp</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b9yts4hKDyh2Pg466p52wQ.png" /></figure><h4>Add Intent: Ask Ingredients</h4><p>Create a new method askIngredients() for handle our intent</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpl.kotl.in%2Fdb4ITw5eT%3Ftheme%3Ddarcula%26from%3D9%26readOnly%3Dtrue%26to%3D23&amp;display_name=Kotlin+Playground&amp;url=https%3A%2F%2Fpl.kotl.in%2Fdb4ITw5eT%3Ftheme%3Ddarcula%26from%3D9%26readOnly%3Dtrue%26to%3D23&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=kotl" width="800" height="300" frameborder="0" scrolling="no"><a href="https://medium.com/media/17176bee34d1273f905141eb483d8a75/href">https://medium.com/media/17176bee34d1273f905141eb483d8a75/href</a></iframe><h4>Deploy the project</h4><p>To deploy the current version, go to the terminal:</p><ul><li>Run: gcloud init</li><li>Run: gradle appengineDeploy or from within IntelliJ, open the Gradle tray and run the appengineDeploy task.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*npNsau79xL5Kg5JjNdZmZw.png" /><figcaption>Before run <strong>appengineDeploy</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tRFrN4x9MuJOQmwaCYwaEw.png" /><figcaption>After run <strong>appengineDeploy</strong>, we need to copy the <strong>target url</strong></figcaption></figure><h3>Dialogflow Fulfillment</h3><h4>Configure Fulfillment in Dialogflow</h4><ul><li>Go to Dialogflow console, from the left navigation menu under <strong>Fulfillment</strong> → <strong>Enable Webhook</strong></li><li>Set the value of URL to <em>https://&lt;YOUR_PROJECT_ID&gt;.appspot.com</em> (you could use the <strong>target url</strong>)</li><li>Press <strong>Save</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3RxId9T9IdmhUTEwXyxweg.png" /></figure><h4>Enable Fulfillment in Intent</h4><ul><li>Open the intent “Ask Ingredients”</li><li>At the bottom of the screen, we have a section called “Fulfillment”</li><li>Open it and flag “Enable webhook call for this intent”, in this way Dialogflow tries to contact our backend before sending the response.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-u3Yo-QZwfS13VIsu4LBQ.png" /></figure><h4>Try it now</h4><p>Now we can try if everything works, use the “Try it now” in Dialogflow and insert our request, for example: “What’s inside the Margherita?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*FyW7LCqsWUH2bWxKdGVnjw.png" /></figure><p>Now that everything works, take a look for the current workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eD0tsJEMvpa9H5HPyl0D6g.png" /></figure><h4>Handle the parameter “PizzaName”</h4><ul><li>Update askIngredients() function and use request.getParameter() to obtain the pizza in the current request.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fpl.kotl.in%2FCG5Dgslqw%3Ftheme%3Ddarcula%26readOnly%3Dtrue%26from%3D20%26to%3D31&amp;display_name=Kotlin+Playground&amp;url=https%3A%2F%2Fpl.kotl.in%2FCG5Dgslqw%3Ftheme%3Ddarcula%26readOnly%3Dtrue%26from%3D20%26to%3D31&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=kotl" width="800" height="300" frameborder="0" scrolling="no"><a href="https://medium.com/media/30a69e3a9855f898c8664ac1f6735ad1/href">https://medium.com/media/30a69e3a9855f898c8664ac1f6735ad1/href</a></iframe><ul><li>Deploy again</li></ul><h3>Try it again!</h3><ul><li>Use “Try it now” in Dialogflow, and click on “See how it works in Google Assistant”</li><li>Accept “Terms &amp; conditions”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wl_7ms_iA79mq5Jhpxy8pg.png" /></figure><ul><li>In the “Develop” tab we can choose a name for our Action and press Save</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBwf4Wr1S9pxXchDCXJGmw.png" /></figure><p>And that’s our final result! 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cpd55C0xfifUWNEK8dOKCg.png" /></figure><h3>Next step — Final tips! 😁</h3><p>We have a working Action backed by our backend. Now we could add some more new intent to complete our project or <a href="https://medium.com/@jackl85/assistant-pizza-tips-tricks-part-5-3fb7f7820224">follow our final tips</a>.</p><h3>Useful links</h3><h4>Repository template</h4><p><a href="https://github.com/omarmiatello/dialogflow-appengine-kotlin">omarmiatello/dialogflow-appengine-kotlin</a></p><h4>Repository final project</h4><p><a href="https://github.com/IncredibleAmazingPizza/dialogflow-pizza">IncredibleAmazingPizza/dialogflow-pizza</a></p><h4>Other articles on Medium</h4><p><a href="https://medium.com/google-developers/announcing-the-java-kotlin-client-library-for-actions-on-google-217828dead">Announcing the Java &amp; Kotlin client library for Actions on Google</a></p><h4>Official links</h4><ul><li><a href="https://github.com/actions-on-google/actions-on-google-java">Java/Kotlin library for Actions on Google</a></li><li><a href="https://github.com/actions-on-google/dialogflow-webhook-boilerplate-java">Dialogflow — Java example</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e914a3a8d044" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assistant & … Pizza — Intent  — Part 3]]></title>
            <link>https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161?source=rss-3f1cdfeb7721------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb963c45d161</guid>
            <category><![CDATA[actions-on-google]]></category>
            <category><![CDATA[dialogflow]]></category>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Omar Miatello]]></dc:creator>
            <pubDate>Fri, 14 Feb 2020 19:14:19 GMT</pubDate>
            <atom:updated>2020-03-17T10:52:54.964Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bo4272GRb6PLz6BComkgOw.jpeg" /><figcaption>Pizza Margherita con cornicione ripieno @ <a href="https://goo.gl/maps/SxbHtXenDb8NyAyz8">Pizzeria Fofò Mattozzi (Milano, Italy)</a></figcaption></figure><h3>Assistant &amp; … Pizza 🍕 — Intent — Part 3</h3><h4>Build Actions on Google Assistant with Kotlin — Create your first Intent, define Entities and parameters!</h4><blockquote>This article is part of a series “Build Actions on Google Assistant with Kotlin!”<br><a href="https://medium.com/@jackl85/assistant-pizza-overview-part-1-7233ca547e87">Overview</a> | <a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc">Dialogflow</a> | <a href="https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161"><strong>Intent</strong></a> | <a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044">Backend</a> | <a href="https://medium.com/@jackl85/assistant-pizza-tips-tricks-part-5-3fb7f7820224">Tips &amp; Tricks</a></blockquote><p>Previously, we explored <a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc">how to start a conversation</a> using the Welcome Intent. The next step will be more related to the users and how they will interact with our Action.</p><h3>Define new Intents</h3><blockquote>We should recall how the Agent may welcome the user: “Hi! May I help you with pizzas and its ingredients?”</blockquote><p>At this point, we foresee the users will most probably want to perform one of the 2 actions:</p><ul><li><strong>Ask Ingredients</strong>: is what we define the <strong>happy path</strong>, as it’s the main interaction with our Action. Users may ask questions like “<em>what are the ingredients of Margherita?</em>”.</li><li><strong>Help</strong>: can be trigger whenever users don’t know how to proceed and when they want to know what are the possible interactions available.</li></ul><h4>Intent: Help</h4><p>As a first step, we want to tackle the Help path. This is the simplest interaction and it will give us a better overview of how to create, manage, and train an Intent!</p><p>We start by creating an Intent, which requires us to feed in the following information:</p><ul><li><strong>Intent name</strong>: give it a name that helps us understand the user intention, for example, Help is very clear.</li><li><strong>Training phrases</strong>: we should add all the phrases that could trigger this Intent, for example: “what can you do?”, “can you help me?”, “what can I say?”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kLP_0A2GO9MCY0zTBFZlwA.png" /><figcaption>Training phrases — Example for “Help” Intent</figcaption></figure><ul><li><strong>Responses</strong>: this intent requires a very simple response. We just need to explain the functionality of our Action. We could add more than one response, but our users would only receive a randomly picked one each time.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fn17KU9S9tE92EYckjFuIw.png" /></figure><ul><li>Click <strong>Save</strong> and we are done. 🎉 <br>To try it, we can click on the top-right section.</li></ul><h4>Intent: Ask Ingredients</h4><p>Now that we have a general understanding of how to create a basic Intent, we want to focus on something more challenging. We should handle the Ask Ingredients request.</p><p>Once more, we want to feed in the data, in the same way we filled the previous Help Intent:</p><ul><li><strong>Intent name</strong>: Ask Ingredients.</li><li><strong>Training phrases</strong>: we should handle phrases like: “what are <em>Margherita</em>’s ingredients?”.<br>In this case, after we match the intent, we want to extract the pizza name and then we can easily use it to generate a response.</li></ul><p>Before continue, we should define a new <strong>Entity</strong> PizzaName that contains our pizzas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9g4uQZj2OsgfXWfRgH57eA.png" /></figure><p>Now we can add the training phrases in our intent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B7me8Kr57vWPbS4gubJVRw.png" /></figure><ul><li><strong>Action and Parameters</strong>: we want to extract the PizzaName so we have to parse raw end-user input. If we have already defined an Entity, Dialogflow will automatically highlight the parameter we need to extract, set a default name and the correct type.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wvsA5w1b3TSWpJtQFiCZPQ.png" /></figure><p>In our case, PizzaName is required to answer correctly to the user. We should flag the “Required” field and add a “Prompts” for this parameter.</p><blockquote>User says “What are the ingredients?”, our Agent says “which pizza?”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzXc_X7VltKkdZ_nDRXOEw.png" /></figure><ul><li><strong>Responses</strong>: this time we can’t use the predefined responses’ list, we need to customize the responses using the PizzaName parameter, we can do it using a backend service. But, what happens if it’s not available? We should add here the responses for that case.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucVUTQo9Y6R_HnYsbJwsNw.png" /></figure><p>This is the current flow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4__5__gcpX-E_D4VY6RPCA.png" /></figure><h3>Next step — Define a custom response!</h3><p>Now that we have our Intent, we could create a custom response with backend service. For example, we could use <a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044">Google App Engine with Kotlin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb963c45d161" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assistant & … Pizza  — Dialogflow — Part 2]]></title>
            <link>https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc?source=rss-3f1cdfeb7721------2</link>
            <guid isPermaLink="false">https://medium.com/p/220b6f9f4ddc</guid>
            <category><![CDATA[actions-on-google]]></category>
            <category><![CDATA[dialogflow]]></category>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Omar Miatello]]></dc:creator>
            <pubDate>Fri, 07 Feb 2020 13:50:58 GMT</pubDate>
            <atom:updated>2020-03-17T10:52:59.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*krouyFeUFea9t1Sg9N8irQ.jpeg" /><figcaption>Pizza Primo Amore, San Daniele e scaglie di Grana @ <a href="https://goo.gl/maps/fbic4dnaBHjZ16Xu5">Pizzeria Hollywood (Treviglio, Italy)</a></figcaption></figure><h3>Assistant &amp; … Pizza 🍕 — Dialogflow — Part 2</h3><h4>Build Actions on Google Assistant with Kotlin! — Prepare the environment!</h4><blockquote>This article is part of a series “Build Actions on Google Assistant with Kotlin!”<br><a href="https://medium.com/@jackl85/assistant-pizza-overview-part-1-7233ca547e87">Overview</a> | <a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc"><strong>Dialogflow</strong></a> | <a href="https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161">Intent</a> | <a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044">Backend</a> | <a href="https://medium.com/@jackl85/assistant-pizza-tips-tricks-part-5-3fb7f7820224">Tips &amp; Tricks</a></blockquote><p><a href="https://dialogflow.com/"><strong>Dialogflow</strong></a> is a free service (with <a href="https://cloud.google.com/dialogflow/quotas">quotas</a>) by Google that <strong>uses machine learning</strong> to understand what users are saying.</p><h3>Dialogflow Console</h3><h4>Create your first Agent</h4><p>An Agent is a virtual assistant that handles conversations with your users, and it could be the name of your app.</p><p>To create an Agent we have to take a few steps:</p><ul><li>Open <a href="https://console.dialogflow.com/">https://console.dialogflow.com</a>.</li><li>Sign in with your Google Account: Dialogflow needs your permission to access your data, so you need to press “Allow” to continue.</li><li>Once you accept all “Terms &amp; conditions”, you will be presented with the console:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tNLxhF_Ghm5_FpyTzIDuJw.png" /><figcaption>Dialogflow console with no Agents — <a href="https://console.dialogflow.com/">https://console.dialogflow.com</a></figcaption></figure><ul><li>Select “Create Agent” and choose your Agent name, this would be the name of your app — in this example, our agent will be “IncredibleAmazingPizza”</li><li>In a few seconds, the Agent is “ready to learn” 🎉</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bfr6vA6ww88pX9yl9Q-jKw.png" /><figcaption>Dialogflow console after Agent was created</figcaption></figure><h3>How does Dialogflow work?</h3><p>Dialogflow works by matching what a user says with a list of intents: all the user requests could be grouped by intention, this is the <em>Intent</em> of the request. Our Action tries<strong> to match</strong> the <strong>user request to the intents</strong> that we define. We should define the complete list of intents that we want to handle.</p><blockquote>Example: user says “Margherita ingredients?” and match our Intent “<strong>Ingredients</strong>”. An alternative request could be “what’s inside the Margherita?” we want that match the same Intent!</blockquote><p>On the other hand, an <strong>Entity</strong> defines a list of possible options for a parameter. An Intent frequently has a list of parameters that we want to extract.</p><blockquote>In the previous example “Margherita ingredients?” we would like to extract the name of the pizza. The entity could be “<strong>Pizzas</strong>”, and the possible options for this Entity are: “Margherita”, “Marinara”, “Prosciutto”, …</blockquote><p>Additionally, other key concepts come in handy: the <strong>Fulfillment</strong> is a bridge between Dialogflow and our service. Whenever parsing the response requires some application logic, we could send the request, with matched Intent and parameters, to our backend.</p><p>As <strong>Integration,</strong> we usually indicate a list of services that could be handled by our Action. For instance, a few famous services require few to no setup: Google Assistant, Facebook Messenger, Slack, Twitter, and Telegram.</p><h4>Predefined Intent</h4><p>By default, a few Intents are created to handle basic communication with our users for us. These will be called <em>Predefined Intents</em>.</p><p>I suggest trying to interact with our agent before proceeding. On the top-right corner of Dialogflow window, we can find a tool to talk to our Action. We can use it to send a request and see the response while we are developing our Action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*t0zPm3dOysSPEvzF78KXcA.png" /><figcaption>“Try it now” in Dialogflow console</figcaption></figure><p>Our Action should handle a few Intents to help us get started:</p><ul><li><strong>Default Welcome Intent</strong>: this Intent is triggered when our Action receives the “Welcome” event. This is the way that allows you to control how conversions will start.</li></ul><blockquote>Our Action responds “Hello! How can I help you?” or “Good day! What can I do for you today?”</blockquote><ul><li><strong>Default Fallback Intent</strong>: this Intent is triggered when the user request does not match any other Intent. In this way, we can always respond to the user.</li></ul><blockquote>Our Action responds “Could you say that again?” or “Sorry, can you repeat?”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*UrrK_BXgdsa3UL7AqJVPOw.png" /></figure><h4>Customize the “Welcome” Intent</h4><p>The <strong>Default</strong> <strong>Welcome Intent</strong> is usually the first approach with our users, and to make a good first impression we should remember a couple of rules:</p><ul><li><strong>Start with a greeting</strong>: try to define an <strong>Action’s persona</strong> (<a href="https://designguidelines.withgoogle.com/conversation/conversation-design-process/create-a-persona.html">read docs</a>), and use it in all user interactions. We could start with a <strong>formal greeting</strong> “<em>Hello! How can I assist?</em>” or an <strong>informal greeting</strong> “<em>Yo! What’s up?</em>”.</li><li><strong>Let the user take the control</strong>: explain very briefly how to start or suggest how the interaction can be brought on by the users.</li></ul><p>Now, open <strong>Default Welcome Intent</strong> and scroll to the <strong>Responses</strong> section. Here we can customize our responses for this Intent.</p><figure><img alt="Responses example: “Hi! I know the ingredients of the pizzas. Can I help you?”" src="https://cdn-images-1.medium.com/max/1024/1*LMSuaBAN94YHUVJ9mR4zng.png" /><figcaption>A good starting point for our Action!</figcaption></figure><h3>Next step — Off to the quest! 😁</h3><p>Now Dialogflow is configured, we have a general understanding of what we need to build to make a working Action, and <a href="https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161">the fun is about to start</a>!</p><p><a href="https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161">Assistant &amp; … Pizza 🍕— Intent  — Part 3</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=220b6f9f4ddc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assistant & …  Pizza  — Overview — Part 1]]></title>
            <link>https://medium.com/@jackl85/assistant-pizza-overview-part-1-7233ca547e87?source=rss-3f1cdfeb7721------2</link>
            <guid isPermaLink="false">https://medium.com/p/7233ca547e87</guid>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[intro]]></category>
            <category><![CDATA[actions-on-google]]></category>
            <dc:creator><![CDATA[Omar Miatello]]></dc:creator>
            <pubDate>Fri, 31 Jan 2020 09:48:36 GMT</pubDate>
            <atom:updated>2020-03-17T10:53:02.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gnmBKem7UEMtCKbc74xTXQ.jpeg" /><figcaption>Pizza Margherita @ <a href="https://goo.gl/maps/hVfA9jU2XiwsjDm26">Pizzeria Assaje Segrino (Milano, Italy)</a></figcaption></figure><h3>Assistant &amp; … Pizza 🍕 — Overview — Part 1</h3><h4>Build Actions on Google Assistant with Kotlin — Build your first: “Hey Google, what is the next …”</h4><blockquote>This article is part of a series “Build Actions on Google Assistant with Kotlin!”<br><a href="https://medium.com/@jackl85/assistant-pizza-overview-part-1-7233ca547e87"><strong>Overview</strong></a> | <a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc">Dialogflow</a> | <a href="https://medium.com/@jackl85/assistant-pizza-intent-part-3-cb963c45d161">Intent</a> | <a href="https://medium.com/@jackl85/assistant-pizza-backend-part-4-e914a3a8d044">Backend</a> | <a href="https://medium.com/@jackl85/assistant-pizza-tips-tricks-part-5-3fb7f7820224">Tips &amp; Tricks</a></blockquote><p>Nowadays we are surrounded by smart devices that can understand what we say, from Android smartphones to smart speakers powered with Google Assistant.</p><p>These “smart” devices are great if we want to play some music or for setting up a timer. Unfortunately, if we ask something more challenging, the answer we get is way too often a “Sorry, I don’t know how to help you”.<br>Let’s see if we can help them 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A-YxY_voDT8VjATw" /><figcaption>Photo by <a href="https://unsplash.com/@kevnbhagat?utm_source=medium&amp;utm_medium=referral">Kevin Bhagat</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>How to build a smarter assistant</h4><p><a href="https://developers.google.com/actions/overview">Actions on Google</a> let you extend the functionality of Assistant making any device able to respond to a huge variety of other situations:</p><ul><li><strong>Local business</strong>: “Hey Google, what are the special offers by <em>Incredible Amazing Pizza</em>?”</li><li><strong>Events</strong>: “Hey Google, when is the next DevFest Levante?”</li><li><strong>Services</strong>: “Hey Google, where is the closest available City Bike?”</li><li>just any information available in digital format.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTlNaiXDQNDxD6pcg79ByA.jpeg" /><figcaption>Source: <a href="https://developers.google.com/actions/overview">https://developers.google.com/actions/overview</a></figcaption></figure><h3>Start your first Action on Google</h3><p>Now, let’s start with an example, we want to help the customers of our imaginary “<strong>Incredible Amazing Pizza</strong>” restaurant.</p><p>Before we dive into how we can build our Action, we have to understand how a user can interact with Google Assistant.</p><p>There are 2 ways to do so:</p><ul><li><strong>Explicit intent</strong>: user says they <strong>want to talk to</strong> our Action by using the complete name</li></ul><blockquote>Example: user says “Hey Google, talk to Incredible Amazing Pizza”</blockquote><ul><li><strong>Implicit intent</strong>: user asks a generic question that <strong>can be handled</strong> by our Action</li></ul><blockquote>User says “Hey Google, what are the ingredients of a Margherita?”</blockquote><h3>Explicit intent</h3><p>Graphically, this is what happens when a user asks to talk to an Action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_w2j1Jwl4aNdkQBQDyC78w.png" /></figure><ul><li><strong>User</strong>: “talk to Incredible Amazing Pizza”</li><li><strong>Google Assistant</strong> <em>opens our Action by starting the Welcome event</em></li><li><strong>User</strong> <em>asks supported questions</em></li><li><strong>Google Assistant</strong> <em>processes requests and responds to user</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*ROVpk0MfLEPLpHv8f3-GJw.png" /></figure><p>From a developer’s point of view, things are slightly more complicated.</p><p>We usually need several pieces for a simple Action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OeZqfv206SlEBaRnUUwotw.png" /></figure><ul><li><strong>Actions on Google</strong>: it’s the service that describes the app, it contains a name, a description, and everything is needed to distribute our app. It also allows us to test the app on different Assistant-enabled devices.</li><li><strong>Dialogflow</strong>: it’s the service that converts the user’s request to an intent.</li></ul><blockquote>User says “I want something sweet! Probably a hot coffee is ok” will match the intent “Add Drink” in Dialogflow.</blockquote><ul><li><strong>Backend</strong>: to handle more complicated questions. This might need some “applicative logic”, we could use our backend, which handles the Intent with some optional parameters.</li></ul><p>Taking into account the example we described from the users’ point of view, let’s see how this Action can be managed more deeply.</p><p>Users will always interact with Actions on Google, which is the main entry point on any device running Assistant. Actions on Google is only the interface we chose to publish our app. Requests will be analyzed by Dialogflow, which will extract the information we need from requests to provide us with a structured answer.</p><p>This service alone is not enough, we need something that can execute the requests and give back results, the backend can process the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*YBgeRxkQH5JmcceY3lOSzA.png" /></figure><h3>Next step — Setup the environment! 📜</h3><p>We now have a general understanding of what we need. We should <a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc">prepare the environment for developing our Action</a>.</p><p><a href="https://medium.com/@jackl85/assistant-pizza-dialogflow-part-2-220b6f9f4ddc">Assistant &amp; … Pizza 🍕 — Dialogflow — Part 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7233ca547e87" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>