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 Flask Python Framework and the Kompose Bot, you will be able to build intelligent chatbots.
In this post, we will learn how to add a Kompose chatbot to the Python framework Flask.
Előfeltétele:
Szükséged lesz egy Kommunikálj account for deploying the python chatbot.
Kommunicate is a no-code, hybrid chatbot platform that is built over a powerful Conversational AI system.
Also, you will need Piton and the Flask framework installed on your system. To read more info about the Flask framework, please follow this link.
Ebben az oktatóanyagban a Flask-ot fogjuk használni. Ha a Dialogflow chatbotot szeretné hozzáadni a Django keretrendszerhez, megtekintheti ezt az oktatóanyagot.
Steps to Create a Chatbot using Kompose and Flask Python Framework:
Step1: Login to your Kommunicate dashboard. If you don’t already have a Kommunicate account, you can create one itt.Navigate to the Kompose bot builder category and create a new bot by selecting the “Create Bot” button.
Lépés 2: Navigate to the Kompose Bot Builder, select your bot and click on the “Settings” option present at the top right corner.
Click on the Webhook option present on that page. Here, we need to put the Webhook Name and Webhook URL.
Step3: Create Webhook URL using Python with Flask and enable the webhook server using ngrok
The webhook requires a URL, and it should be an HTTPS protocol. The webhook URL will receive a POST request from the Kompose Bot every time an intent triggers the webhook.
We are using the Python programming language and the Flask framework to create the webhook.
Create a file (for example — app.py). Import all the necessary libraries (ex: os, JSON, flask_ngrok, request) needed for Python. Please check if you have Flask on your system. If not, install it using pip, and here’s the dokumentáció ugyanazért.
To handle all the agent webhook requests, we need to define and add a route/webhook method with a POST request. This URL /webhook will receive a POST request. It executes all the methods inside the method.
A Python folyamat beállítása után használjuk flask ngrok to create a public URL for the webhook and listen to port 5000 (in this example). For Kompose webhook, 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 the following URL:
https://85e6-203-189-248-8.ngrok.io/webhook , Ahol a webhorog is the POST route for Kompose we mentioned in the Python file.
Lépés 4: Configure Webhook inside Kompose Settings Page
Copy the URL you created (https://85e6-203-189-248-8.ngrok.io/webhook) — in this example and paste it into the Kompose webhook URL field. Here, I have written the Webhook name as “Test.”
Lépés 5: Create an intent by clicking on the +Add button under the “Answer” section and “Train the Bot.”
Here, I have created Flask intent and added a training phrase as “What is Flask?”
Lépés 6: Click on the “Bot Says” option and select the webhook that you created earlier. Here, I have selected the Test webhook created earlier. Now, click on “Train Bot.”
Step 7: Testing
Once the setup is done, you can easily adja hozzá webhelyéhez vagy alkalmazásaihoz a Kommunicate segítségével.
& test if the Python chatbot is working.
There you have it, a Python chatbot for your website created using the Flask framework. If you want to read more about how to build a chatbot, you can visit our blog post itt.
Originally Published at https://www.kommunicate.io/ A 26 / 05 / 2022
AI Chatbot létrehozása Python Frameworkben eredetileg a Chatbotok élete a Medium oldalon, ahol az emberek folytatják a beszélgetést, kiemelve és válaszolva erre a történetre.
- Coinsmart. Európa legjobb Bitcoin- és kriptográfiai tőzsdéje.
- Platoblockchain. Web3 metaverzum intelligencia. Felerősített tudás. SZABAD HOZZÁFÉRÉS.
- CryptoHawk. Altcoin radar. Ingyenes próbaverzió.
- Source: https://chatbotslife.com/how-to-create-a-ai-chatbot-in-python-framework-e781930a47d0?source=rss—-a49517e4c30b—4
- "
- 7
- a
- Rólunk
- Fiók
- hozzáadott
- AI
- Minden termék
- már
- app
- alkalmazások
- Blog
- Bot
- épít
- építész
- Kategória
- bonyolult
- Beszélgetés
- beszélgetések
- teremt
- készítette
- műszerfal
- bevezetéséhez
- domain
- könnyen
- lehetővé
- példa
- vezetéknév
- következik
- következő
- Keretrendszer
- ból ből
- fogantyú
- itt
- Hogyan
- How To
- HTTPS
- Az emberek
- hibrid
- info
- telepíteni
- Intelligens
- A szándék
- IT
- nyelv
- TANUL
- helyi
- keres
- közepes
- említett
- mód
- több
- elengedhetetlen
- opció
- Emberek (People)
- emelvény
- kérem
- pont
- erős
- be
- folyamat
- Programozás
- protokoll
- nyilvános
- közzétett
- kap
- kérni
- kéri
- megköveteli,
- Útvonal
- szabályok
- azonos
- biztosított
- kiválasztott
- beállítás
- felépítés
- Egyszerű
- óta
- szoftver
- Történet
- rendszer
- teszt
- A
- Keresztül
- idő
- szerszámok
- felső
- Képzések
- alatt
- használ
- weboldal
- Munka
- dolgozó
- A te