Skip to content

Commit

Permalink
remove import in __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Faizal B H committed Aug 22, 2020
1 parent cff5348 commit 36b47e5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 30 deletions.
69 changes: 42 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Installation

Usage
======
For Web Bot
-----------
in settings.py add the following::

INSTALLED_APPS = [
Expand All @@ -43,30 +45,9 @@ in urls.py add the following::
...
]

For Microsoft Bot Framework Webhook
-----------------------------------

in addition to the above in settings.py add
::

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("botframework-webhook/",
botframework.web_hook,
name="botframework-webhook"),
...
]

Web Hook API (should authenticate before API request)
=====================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::

URL: /webhook/
Expand All @@ -79,15 +60,49 @@ Web Hook API (should authenticate before API request)
"status": "Success",
"messages": [
{
"id": 6, "text": "what is dosa",
"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",
"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"),
...
]
3 changes: 0 additions & 3 deletions django_chatbot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from .chatbot import chat


VERSION = (0, 0, 2)
__version__ = '.'.join(map(str, VERSION))

Expand Down

0 comments on commit 36b47e5

Please sign in to comment.