Giter VIP home page Giter VIP logo

microsoft-chatbot's Introduction

Microsoft-chatbot

Microsoft chatbot build using NLTK-Chatbot and django

To Running This App in Microsoft Bot Emulator

  1. Download Emulator
  2. Install Emulator
  3. in command prompt
     git clone https://github.com/ahmadfaizalbh/Microsoft-chatbot.git
     cd Microsoft-chatbot
     pip install -r requirements.txt
     python manage.py makemigrations
     python manage.py migrate
     python manage.py runserver
  4. Microsoft-chatbot/bot/settings.py set DEBUG = True
  5. open another command prompt and execute the following
     cd Microsoft-chatbot
     python manage.py process_tasks
  6. open Emulator
  7. Add an endpoint for your bot with Endpoint url http://localhost:8000/messaging/ and name localhost and save
  8. open chat and start discussing with the bot

To Run This App in Production

  1. Install postgreSQL follow the instruction in page How to install and use postgresql on ubuntu 14.04
  2. in shell prompt run
     git clone https://github.com/ahmadfaizalbh/Microsoft-chatbot.git
  3. Go to Azure Portal
  4. Create a microsoft bot - Follow
  5. Generate and then update below lines in Microsoft-chatbot/bot/settings.py
     DEBUG = False
     APP_CLIENT_ID = `<Microsoft App ID>`
     APP_CLIENT_SECRET = `<Microsoft App Secret>`
  6. in Microsoft-chatbot/bot/settings.py also set ALLOWED_HOSTS with list of domain names
  7. create DB chatbot with username app_user and password InfoBotPassword in postgreSQL or change the credential in settings as per your configuration
     create database chatbot;
     create user app_user with encrypted password 'InfoBotPassword';
     grant all privileges on database chatbot to app_user;
  8. in shell prompt run
     cd Microsoft-chatbot
     pip install -r requirements.txt
     python manage.py makemigrations
     python manage.py migrate
  9. run python manage.py process_tasks in background (put it in /etc/rc.local with appropriate path to python and manage.py)
  10. configure apache2 config file for this project
  11. install Let's Encrypt
  12. restart server

microsoft-chatbot's People

Contributors

ahmadfaizalbh avatar dependabot[bot] avatar quicklearner171998 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

microsoft-chatbot's Issues

Some issues with chat handling

First off, thanks for the great framework.
To get this working in my envirnoment I had to change the request data scope(msbot/views.py line 217) from:
https://graph.microsoft.com/.default to https://api.botframework.com/.default
I also needed to utf-8 decode the json response in conversation_handler.
Responses from the bot are working, but I have some issues with the chat handler/models, maybe you could help me in the right direction.

Key error when starting new none threaded conversation with the bot:

  File "/****/****/msbot/views.py", line 166, in __getitem__
    return self.objClass(Sender.objects.get(messengerSenderID=sender_id).messengerSenderID)
  File "/usr/local/lib/python3.4/dist-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/django/db/models/query.py", line 403, in get
    self.model._meta.object_name
msbot.models.DoesNotExist: Sender matching query does not exist.

And during handling:

  File "/usr/local/lib/python3.4/dist-packages/background_task/tasks.py", line 43, in bg_runner
    func(*args, **kwargs)
  File "/****/****/msbot/views.py", line 289, in respond_to_client
    chat.conversation[sender_id].append(message)
  File "/****/****/msbot/views.py", line 168, in __getitem__
    raise KeyError(sender_id)

Again, thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.