Author: Franz Malten Buemann

  • How to Integrate Dialogflow Chatbot to Python Frameworks

    Chatbots are software tools created to interact with humans through chat. The first chatbots were able to create simple conversations based on a complex system of rules. Using Python and Dialogflow frameworks, you would be able to build intelligent chatbots.

    In this post, we will learn how to add a Dialogflow chatbot to Python frameworks such as Flask or Django.

    Pre-requisites:

    You will need a Dialogflow account, a Kommunicate account for deploying the chatbot. Also, you will need Python and Flask frameworks installed on your system. To need more info about the Flask framework, please refer to this link.

    We will be using Flask in this tutorial. If you are looking to add Dialogflow chatbot to the Django framework, you can see this tutorial.

    Steps to Add Dialogflow Chatbot to Python Frameworks

    Create an agent

    Login to the Dialogflow console. An agent is just a chatbot. You can train the agent with training phrases and corresponding responses to handle expected conversation scenarios with your end-users.

    Click the dropdown near the Agent settings, then click Create new agent, provide an agent name (For example — Python-Demo), then click CREATE.

    Create an intent

    An intent categorizes end-users intention for one conversation turn. For each agent, you can define many intents. When an end-user writes or says something, referred to as an end-user expression, Dialogflow matches the end-user expression to the best intent in your agent.

    Click the CREATE INTENT button and provide an intent name (for example, python-demo) and save.

    Trending Bot Articles:

    1. How Conversational AI can Automate Customer Service

    2. Automated vs Live Chats: What will the Future of Customer Service Look Like?

    3. Chatbots As Medical Assistants In COVID-19 Pandemic

    4. Chatbot Vs. Intelligent Virtual Assistant — What’s the difference & Why Care?

    Add training phrases

    These are example phrases for what end-users might say. When an end-user expression resembles one of these phrases, Dialogflow matches the intent.

    Click the intent created (python-demo) and add the user phrases in the Training phrases section.

    🚀 Here’s a video for you on creating a Dialogflow chatbot and learning more about agents, intents, and entities:

    Enable fulfillment

    After adding an intent, you don’t need to add agent responses in the Responses section. Since we are using Flask for the same, you need to enable webhook for this intent. The webhook will help us transfer data and responses between Dialogflow and Flask. Dialogflow provides webhook services via Dialogflow Fulfillment.

    Fulfillment is a code deployed through a web service to provide data to a user. You can enable webhook calls for all those intent that required some backend processing, database query, or third-party API integration.

    Under the Fulfillment section, click Enable webhook for this intent and save the intent.

    Dialogflow fulfillment has two options — Webhook and Inline Editor. The inline editor is also a webhook but hosted by Google cloud functions. We are going to use the webhook.

    Go to the “Fulfillment” section & enable Webhook.

    Using Python with Flask & enable webhook server

    The webhook requires a URL, and it should be an HTTPS protocol. The webhook URL will receive a POST request from Dialogflow every time an intent triggers the webhook.

    We are using Python programming language and Flask framework to create the webhook.

    Create a file (for example — app.py). Import all the necessary libraries (ex: os, JSON, send_from_directory, request) needed for Python. Please check if you have Flask on your system. If not, install it using pip, and here’s the documentation for the same.

    import flask
    import json
    import os
    from flask import send_from_directory, request

    To handle all the agent webhook requests, we need to define and add a route/webhook method with a POST request. A POST request will be sent to this URL /webhook. It executes all the methods inside the method.

    Also, a fulfillment text is added to return that when it triggers the training phrase from Dialogflow.

    If you need to add more conditions & responses, you can define them inside the webhook method.

    # Flask app should start in global layout
    app = flask.Flask(__name__)
    @app.route('/favicon.ico')
    def favicon():
    return send_from_directory(os.path.join(app.root_path, 'static'),
    'favicon.ico', mimetype='image/favicon.png')
    @app.route('/')
    @app.route('/home')
    def home():
    return "Hello World"
    @app.route('/webhook', methods=['POST'])
    def webhook():
    req = request.get_json(force=True)
    print(req)
        return {
    'fulfillmentText': 'Hello from the bot world'
    }
    if __name__ == "__main__":
    app.secret_key = 'ItIsASecret'
    app.debug = True
    app.run()

    After setting up the Python process, let’s use Ngrok to create a public URL for the webhook and listen to port 3000 (in this example). For Dialogflow fulfillment, you will need an HTTPS secured server since the local server (localhost) will not work. You can also use a server and point a domain with HTTPS to that server.

    You will get a URL like https://f3e3a29d7ae9.ngrok.io/webhook where the webhook is the POST route for Dialogflow we mentioned in the Python file.

    Copy the URL you created (In this example — https://f3e3a29d7ae9.ngrok.io/webhook) and paste it into the Dialogflow fulfillment URL field.

    Once the Dialogflow setup is done, you can easily add it to your website or apps using Kommunicate & test the Python chatbot working.

    Wrapping Up

    How easy was that? In a few simple steps, you can add a Dialogflow chatbot to your Python frameworks. Do try this out and let us know in the comments. We would love to try your chatbot out.

    This article was originally published here.

    Don’t forget to give us your 👏 !


    How to Integrate Dialogflow Chatbot to Python Frameworks was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • How to Create a WordPress Chatbot Without Any Coding

    What is WordPress?

    WordPress is a free open source content generation and management system used by companies and businesses (with its WooCommerce tool), and it can also serve as an e-commerce platform.
    More and more companies only work through the internet, transferring their location from a physical space to a virtual one.

    One of the great benefits of WordPress with a plugin architecture. It allows users to extend the features and functionality of a website or blog with cutting-edge technologies.

    Quick summary:

    1. What is a chatbot
    2. How to create a WordPress chatbot
    3. Steps to activate your chatbot to handle all your conversations
    4. How to add a chatbot widget to your WordPress website

    1. What is a chatbot?

    The chatbot uses natural language processing, which translates human language into data deciphered with recurring text and patterns and shapes them into automated answers and responses.

    Just like when you chat with a real person, users can talk to a chatbot via voice recognition, or type in the chat interface.

    Bonus: What is Chatbot how do they work

    2. How to create a chatbot for your WordPress website?

    • Sign up for Kompose, a GUI bot builder based on natural language conversations for Human-Computer interaction. You don’t need any coding skills to master Kompose. It has a simple, intuitive, and easy-to-use interface. Sign up here.
    • Go to the Bot integrations section and use the “Create a Bot” option to create one.
    • Name your bot, set its language (as Kompose supports most used languages), and click save.
    • Create your first welcome message and embed Texts, Buttons, Images, or other rich media types.
    • Create answers for the bot. Define the intent that is possible and mention the phrases that you expect will trigger the communication. With time your bot will learn.
    • If you don’t want to create your Chatbot from scratch, you can also use one of the available chatbot templates.

    Trending Bot Articles:

    1. How Conversational AI can Automate Customer Service

    2. Automated vs Live Chats: What will the Future of Customer Service Look Like?

    3. Chatbots As Medical Assistants In COVID-19 Pandemic

    4. Chatbot Vs. Intelligent Virtual Assistant — What’s the difference & Why Care?

    3. How to set your chatbot to handle all your customer conversations

    Once you create a chatbot, you can set it as a default bot in the conversation routing rules section as shown below.

    • Click on ⚙️Settings >> Conversation rules >> Routing rules for bots >> Then click on bot like below and select your bot.

    Now, your bot will reply to all of your conversations.

    4. How to add a chatbot widget to your WordPress website

    Step 1: Log in to your WordPress dashboard & Navigate to plugins

    From the left navigation panel, click on Plugins. After that, click on Add New

    Step 2: Add Kommunicate Plugin

    Navigate to the search bar and search for ‘Kommunicate’. Click on the Install now button and activate it.

    Step 3: Add your Kommunciate App ID

    Go to your Kommunicate dashboard > Settings > Install > Copy your App ID

    Then, Go to Kommunicate settings in your WordPress dashboard > Paste your Kommunicate App ID and click on save changes

    Refresh your page and now your chatbot widget should be live on your WordPress website.

    Wrapping Up

    Creating and installing your WordPress chatbot is as simple as it gets and requires no coding skills or technical expertise. Use the live chat and bots to connect quickly with visitors to your website and with customers.

    This article was originally published here.

    Don’t forget to give us your 👏 !


    How to Create a WordPress Chatbot Without Any Coding was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • looking for Onlineshops in austria which use a chatbot

    Hi,

    I write my master thesis about austrian Online shops and communication with Chatbots. Sadly, right now i cant find any small onlineshop in austria with a chatbot. Are there any ideas how i could find a few?

    submitted by /u/Ughurr
    [link] [comments]

  • 18 Best Practices for Onboarding Remote Employees

    Life at work will not return to the pre-COVID-19 world we’re used to having.

    Gone were the days of fully packed conference halls for quarterly town halls and for those who are permanently working from home, gone were the days of face-to-face water cooler conversations with colleagues in the office.

    With remote working becoming the ultimate norm, how do we inject the working culture employees are so fond of into the virtual space and integrate new hires into both the formal and informal work culture of a particular organisation? 

    Here’s where remote onboarding or virtual onboarding comes in.

    In this article, we round up 20 best practices for onboarding a remote employee. 

  • chatbots for hospitality

    For example, I am building a chatbot for a hotel. And they ask for how the chatbot can go on about this:

    How the flow for guests will be inquiry about an reservation, modifying the reservation, ability to retrive other stuff, etc..

    If someone could explain this to me via a flowchart or a diagram, I would appreciate it!

    submitted by /u/DANANANARoBiN
    [link] [comments]

  • I’ve made a chatbot that deal with loneliness – help me

    Hello!
    As the title says, I’ve made a simple chatbot using DialogFlow that helps people going through feelings of loneliness to process their thoughts.

    It’s the first time I’m trying to make any sort of chatbot, so would really like to hear your expert constructive criticism on how to improve the experience of it.
    (There is a lot to improve and any feedback is really appreciated)

    This is the link to try the chatbot out:
    https://bot.dialogflow.com/2319c344-ca99-436a-8953-e464bea0a8cd

    I’ve seen that some people want to start their own chatbot too, so if you are considering using DialogFlow, I can give you my opinion on it 🙂

    (Mods I’m sorry if this breaks the rule of self promotion. let me know and I can take it down if it’s the case)

    Thank you for reading!

    submitted by /u/mdss101
    [link] [comments]

  • Web developer looking to build a chatbot. Where should I start?

    I’m a full stack developer that only knows Javascript, but I want to learn how to build a chatbot. The chatbot will be used as a virtual assistant that will send emails, set up appointments in calendars, check for availability etc.. you get the picture.

    If you were in my shoes, how would you proceed?

    I’m open to learning python if its needed, I’ve got a lot of free time and would be able to pick it up very quickly. What about AI? Also open to that if it can make my chatbot better.

    submitted by /u/ha1o
    [link] [comments]