Giter Club home page Giter Club logo

botshot's People

Contributors

mzilinec avatar prihoda 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  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  avatar  avatar

botshot's Issues

Exception when initializing flows

Traceback (most recent call last):
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/gunicorn/util.py", line 350, in import_app
    __import__(module)
  File "/home/web/showmax-bot/bot/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/web/showmax-bot/env/lib/python3.5/site-packages/django/apps/registry.py", line 120, in populate
    app_config.ready()
  File "/home/web/showmax-bot/botshot/apps.py", line 10, in ready
    init_flows()
  File "/home/web/showmax-bot/botshot/core/flow.py", line 43, in init_flows
    print('Initialized {} flows: {}'.format(len(flows), sorted(list(flows.keys()))))
TypeError: unorderable types: bool() < str()

Customizable landing page & conditions page

Blank django templates added automatically as bootstrap. The landing page is not necessary, maybe webgui is a better home page. The conditions are needed for messenger so it makes sense to include them in the example.

Status dashboard

Add dashboard view showing status of:

  • Celery and celerybeat
  • Redis
  • Elasticsearch
  • Wit.ai
  • Interfaces (presence of app ids, also we can pull data from Messenger and other interfaces using configured app ids?)
  • Rest of GOLEM_SETTINGS overview

Useful information should be provided when there is a problem with any service.

Server startup

We should investigate everything that happens on each server startup and bring it all into one place. We have to be careful that multiple instances (two by default) of the same server are started up. Some things should be run only once (sending messenger menu settings), some things in both instances (setting up loggers).

We should also investigate what data gets passed between Celery and Django and when.

Documentation improvements

There are several things that should be added to the documentation to make it easier to get familiar with Botshot.

  • getting started - bots tool
  • how to configure the chatbot, where to find settings
  • how to add new dialogue in YML and code
  • how to use NLU - the user will need to do intent transitions even with the most basic bot
  • message processing pipeline overview

Database is locked

When using sqlite, the bot will crash if there are 2 messages coming at once because of sqlite's basic locking support.

django.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.

django.utils.six was removed from newer versions

When running 'bots init my_bot && cd my_bot' an error is thrown because the django.utils.six module is not available. Installing django version 2.2.9 fixed this issue.

It looks like that module was removed for version 3.0.0 of django.

Changing the install requirement in setup.py to specify between versions 2.1.5 and 2.2.9 would probably fix this issue.

Scheduler not working after apps.py update

Scheduler is not loaded after apps.py update #44.
For some reason, scheduler.py was imported from flows.py in BotshotConfig.ready().
Now that flows are loaded elsewhere, it doesn't get loaded and the update task is never registered.

Delay between messages

Sometimes it is desired to have a "pause" between two messages, for example to indicate that the bot is thinking. This could be done directly in threads, or with a special PauseMessage.

Message validation

  • validate messages before sending
  • common message types => specific messages for a chat service

Human takeover

Human should be able to take over conversation in Messages admin tab. First, " πŸ‘β€πŸ—¨Take over" button will be shown, clicking it will disable the bot and reveal the input field.

Conversations in left panel are grouped into two sections, something like: Human takeover, Bot controlled.

When chatting with the bot, a "Request human reply" action could be triggered to automatically hand over to human and additionally show an ❗️ exclamation mark next to it as "Requested assistance"

Web gui checklist

  • Check vertical template scrolling
  • Refresh messages list properly (websocket?)

INSTALLED_APPS weird behavior

For some reason, these have different effect.
INSTALLED_APPS = ('botshot', ...
INSTALLED_APPS = ('botshot.apps.BotshotConfig', ...

For example, when running unit tests, the second variant crashes with "default.root not found".
This indicates that ready() may not be called in the first case.

Forgetting slash leads to error ;-)

If you use "redis://localhost:6379/0" without a slash, BOT_CONFIG.get('REDIS_URL').rstrip("/")+'/1' will crash.

(Of course redis error message just says ValueError: invalid literal for int() with base 10: '0/1')

Message formatting

Special characters like newlines aren't displayed correctly across messaging platforms. Check if it's even possible and replace newlines with the correct characters in the individual chat interfaces.

Refactoring checklist

  • Make private methods private
  • Python 3.5 incompatibility bug
  • Do not import classes in settings file, use strings and importlib

Scheduler improvements

TO DO:

  • test polling and nearest datetime
  • implement user filter (by context?) where to send schedule (e.g. send only to users who subscribed)
  • support sending premade messages using broadcast (without processing each user individually)
  • check if there's no better way of registering periodic task
  • configurable poll interval and task expiration
  • delayed message shortcut

Originally posted by @mzilinec in #41 (comment)

Defer Telegram webhooks init

Telegram webhooks init should not be done when migrating, importing settings or when there is no telegram token. Also there should be a small enough timeout.

Flows are not initialized

When you import from botshot.core.chat_manager import ChatManager
from a flow, botshot will crash with message "flows weren't initialized".
(Branch message_log)

Support ML based dialog transitions

The easiest way to support custom dialog transitions like in Alquist would be just by decoupling and making MessageProcessor abstract, so that we would have for instance FlowMessageProcessor and ProbabilisticMessageProcessor and the chatbot developer would choose in BOT_CONFIG.

@prihoda

User interface with visual flows

It would be great to have a GUI in which the user could see or edit flows visually. Actions that are represented by a function would need to be documented by the developer and this documentation would be shown in the GUI. Optionally, the functions could take some kind of arguments from the dialog builder.

def action(dialog, text_from_non_technical_person: str):
  do_stuff()
  dialog.send(processed_text)

Messenger settings

Messenger bottom menu, get started etc. should be configurable for example from settings.py or in other file.

Default message broker

There should be a default message broker that will get installed using pip, so that the user doesn't have to add it manually.

Deployment to production docs and scripts

In production, the server is not run with botshot start but using a wsgi script. The dependencies should be included in the wsgi script or prepared as separate services.

Add example phrases to flow states

An examples field of possible user phrases could be added to each state to:

  1. Generate automatic help message
  2. Guide an automatic "metabot" conversation with our bot to visualize our flows

Setup static files

For some reason, now that webgui is hosted under /chat by default, django expects static files under /chat/static/css/webchat.css.

Inline entities

Inline entities could be defined like below.

Advantages: avoids repetitive calling of NLU for entities that we're not interested in, faster development, definition at runtime, nice to have in flow builder

Questions:
Should this just use KeywordsExtractor or should it be connected to the "real" NLU? Maybe keywords, word similarity and regex would be nice? (Definitely no training as this can be modified at runtime)

default:
  states:
  - name: ask_user_type
    action: foo
    entities:
    - keywords yesno:
      - 'yes': ['yes', 'yeah', 'sure']
      - 'no': ['no', 'nope', 'nah']

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.