Django webhook for ChatBotAI
Reason this release was yanked:
Error in package
Project description
A Django wrapper with webhook for ChatbotAI
Installation
pip install django-chatbot
Usage
For Web Bot
in settings.py add the following:
INSTALLED_APPS = [ ... 'django.chatbot', ... ] CHATBOT_TEMPLATE = <ChatBotAI template file path> START_MESSAGE = "Welcome to ChatBotAI"
in urls.py add the following:
from django.chatbot.views import web_hook urlpatterns = [ ... path("webhook/", web_hook, name="webhook"), ... ]
Web Hook API (should authenticate before API request)
URL: /webhook/ Method: POST Data: { last_message_id: 5, message: "what is dosa" } Response: { "status": "Success", "messages": [ { "id": 6, "text": "what is dosa", "created": "2020-03-22 19:42:59", "by": "user" }, { "id": 7, "text": "A dosa is a cooked flat thin layered rice batter, originating from South India, made from a fermented batter....", "created": "2020-03-22 19:42:59", "by": "bot" } ] }
For Microsoft Bot Framework Webhook
pip install django-background-task
in settings.py add the following:
INSTALLED_APPS = [ ... 'background_task', 'django.chatbot', ... ] CHATBOT_TEMPLATE = <ChatBotAI template file path> START_MESSAGE = "Welcome to ChatBotAI" APP_CLIENT_ID = "<Microsoft App ID>" APP_CLIENT_SECRET = "<Microsoft App Secret>"
in urls.py add the following:
from django.chatbot.views import botframework urlpatterns = [ ... path("webhook/", botframework.web_hook, name="botframework-webhook"), ... ]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-chatbot-0.0.2.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for django_chatbot-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57660740fc13bf6253219de0ff9e7dd2c15b49632ea50a43b2d764255b123998 |
|
MD5 | 5c668c36fbee79cb82517fd84edc51df |
|
BLAKE2b-256 | 2c75d88460720cab206dd54cc5c32009c3a1437d29a90438b56b55c6c5c83486 |