<?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 Santi Adavani on Medium]]></title>
        <description><![CDATA[Stories by Santi Adavani on Medium]]></description>
        <link>https://medium.com/@AdavaniSanti?source=rss-b1ff21c8185d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mvQpkA0siL3lluJa.jpg</url>
            <title>Stories by Santi Adavani on Medium</title>
            <link>https://medium.com/@AdavaniSanti?source=rss-b1ff21c8185d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 19:45:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@AdavaniSanti/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[Chatbot using django rest framework + api.ai + slack — Part 1/3]]></title>
            <link>https://blog.chatbotslife.com/chatbot-using-django-rest-framework-api-ai-slack-part-1-3-69c7e38b7b1e?source=rss-b1ff21c8185d------2</link>
            <guid isPermaLink="false">https://medium.com/p/69c7e38b7b1e</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Santi Adavani]]></dc:creator>
            <pubDate>Wed, 18 Jan 2017 02:00:24 GMT</pubDate>
            <atom:updated>2017-02-01T19:39:10.612Z</atom:updated>
            <content:encoded><![CDATA[<p>In this three part blog, I will go over design and development of an <a href="http://eventsbot.co/">events chatbot </a>using custom backend built with Django Rest Framework, API.AI and Slack.</p><h4><strong>Parts</strong></h4><ol><li>Chatbot definition, architecture and API.ai agent setup.</li><li>Steps to integrate DRF, API.AI, and Slack to get basic responses from your backend.</li><li>Steps to send rich Slack message from your backend.</li></ol><h4>Chatbot</h4><p>First step is to clearly define the bot’s purpose. We want our events chatbot to show a list of events with all the relevant information only when it is prompted. Information includes event’s title, start and end time, location, link to maps and calendar. Prompt can be anything from the list below or a variation:</p><ul><li>hey, what are the events on Christmas?</li><li>events tomorrow</li><li>events day after tomorrow</li><li>events on Dec 21</li><li>events tomorrow afternoon</li><li>events with free beer</li><li>events on python tomorrow evening</li><li>….</li></ul><h4>Architecture</h4><p>In the block diagram below, I show the interactions between Django, API.ai, and Slack. Each of these blocks play a specific role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hwlWoqvJX3xpCuyZDaiaA.png" /><figcaption>Chatbot architecture</figcaption></figure><p><strong>Slack </strong>is the only interface that the user interacts with. Chatbot resides in Slack. Bot’s response is rich in nature with cards, links to maps, calendar and other apps.</p><p><strong>API.AI</strong> is the natural language processing (NLP) brains that translates user’s prompt to structured data with <a href="https://docs.api.ai/docs/concept-intents">intents</a>, <a href="https://docs.api.ai/docs/concept-entities">entities</a> and <a href="https://docs.api.ai/docs/concept-contexts">contexts</a>.</p><p><strong>Django</strong> has the business logic to query the database based on intents, entities and contexts from API.ai and create rich slack messages.</p><h4><strong>API.AI setup</strong></h4><p>Refer to this very well written <a href="https://docs.api.ai/docs/get-started">tutorial</a> for setting a basic bot in API.ai. I will go over the methodology to create intents for events bot. All the prompts above may look very similar. However, for a prompt like “events tomorrow” we are only looking for tomorrow’s <strong><em>date</em></strong> to list all events and for a prompt like “events tomorrow evening” we are looking for a <strong><em>date</em></strong> and <strong><em>time-range</em></strong>. So, it is important to split the prompts into multiple sections in order to setup the agent. We will split them into two sections, which will be our intents.</p><p><strong>Get events for a date</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ErmnC6jiyuhD3jOd7JchDQ.png" /><figcaption>User prompts for Events for a given date</figcaption></figure><p><strong>Get events for a date and time range</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ju_7j3Ac81maWz9T4fhbw.png" /><figcaption>User prompts for Events for a given date and time range</figcaption></figure><p><strong>Try out API.AI test console</strong></p><p>Check the date and time-period for different variations of the prompts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*nNF9WkrnYYDTpmeCR0zg-A.png" /></figure><p>In part 2, I will go over steps involved in creating and deploying DRF app, enabling webhook in API.AI, and starting the bot in a slack channel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*bQlRSzFHJEmF4Q7PyrLgng.gif" /></figure><figure><a href="https://chatbotslife.com/bot-communities-mastermind-group-d2dae9876709#.53x0py6ou"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*6XUspT9JOSq0w0Fi35HIaA.png" /></a></figure><figure><a href="https://m.me/ChatbotsLife"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*c1LDMH5vbnIz9rmAka8Hwg.png" /></a></figure><figure><a href="https://chatbotslife.com/how-to-get-a-free-chatbot-b1fb9dfe109#.z9dtp2sy0"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*D0Jf3dI6ZThtqcfwDYY7mg.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69c7e38b7b1e" width="1" height="1" alt=""><hr><p><a href="https://blog.chatbotslife.com/chatbot-using-django-rest-framework-api-ai-slack-part-1-3-69c7e38b7b1e">Chatbot using django rest framework + api.ai + slack — Part 1/3</a> was originally published in <a href="https://blog.chatbotslife.com/">Chatbots Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>