├── docs ├── cache.json ├── build │ ├── html │ │ ├── _static │ │ │ ├── custom.css │ │ │ ├── up.png │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── comment.png │ │ │ ├── up-pressed.png │ │ │ ├── ajax-loader.gif │ │ │ ├── comment-close.png │ │ │ ├── down-pressed.png │ │ │ ├── comment-bright.png │ │ │ ├── fonts │ │ │ │ ├── Lato-Bold.ttf │ │ │ │ ├── Inconsolata.ttf │ │ │ │ ├── Lato-Regular.ttf │ │ │ │ ├── Lato │ │ │ │ │ ├── lato-bold.eot │ │ │ │ │ ├── lato-bold.ttf │ │ │ │ │ ├── lato-bold.woff │ │ │ │ │ ├── lato-bold.woff2 │ │ │ │ │ ├── lato-italic.eot │ │ │ │ │ ├── lato-italic.ttf │ │ │ │ │ ├── lato-italic.woff │ │ │ │ │ ├── lato-regular.eot │ │ │ │ │ ├── lato-regular.ttf │ │ │ │ │ ├── lato-italic.woff2 │ │ │ │ │ ├── lato-regular.woff │ │ │ │ │ ├── lato-regular.woff2 │ │ │ │ │ ├── lato-bolditalic.eot │ │ │ │ │ ├── lato-bolditalic.ttf │ │ │ │ │ ├── lato-bolditalic.woff │ │ │ │ │ └── lato-bolditalic.woff2 │ │ │ │ ├── Inconsolata-Bold.ttf │ │ │ │ ├── RobotoSlab-Bold.ttf │ │ │ │ ├── Inconsolata-Regular.ttf │ │ │ │ ├── RobotoSlab-Regular.ttf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── fontawesome-webfont.woff2 │ │ │ │ └── RobotoSlab │ │ │ │ │ ├── roboto-slab-v7-bold.eot │ │ │ │ │ ├── roboto-slab-v7-bold.ttf │ │ │ │ │ ├── roboto-slab-v7-bold.woff │ │ │ │ │ ├── roboto-slab-v7-bold.woff2 │ │ │ │ │ ├── roboto-slab-v7-regular.eot │ │ │ │ │ ├── roboto-slab-v7-regular.ttf │ │ │ │ │ ├── roboto-slab-v7-regular.woff │ │ │ │ │ └── roboto-slab-v7-regular.woff2 │ │ │ ├── css │ │ │ │ ├── fonts │ │ │ │ │ ├── lato-bold.woff │ │ │ │ │ ├── lato-bold.woff2 │ │ │ │ │ ├── lato-normal.woff │ │ │ │ │ ├── lato-normal.woff2 │ │ │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ │ │ ├── lato-bold-italic.woff │ │ │ │ │ ├── lato-bold-italic.woff2 │ │ │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ │ ├── lato-normal-italic.woff │ │ │ │ │ ├── lato-normal-italic.woff2 │ │ │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ │ └── badge_only.css │ │ │ ├── documentation_options.js │ │ │ ├── js │ │ │ │ ├── badge_only.js │ │ │ │ ├── html5shiv.min.js │ │ │ │ ├── html5shiv-printshiv.min.js │ │ │ │ └── theme.js │ │ │ ├── pygments.css │ │ │ ├── classic.css │ │ │ ├── sidebar.js │ │ │ └── doctools.js │ │ ├── objects.inv │ │ ├── .buildinfo │ │ ├── _sources │ │ │ ├── index.rst.txt │ │ │ ├── modules.rst.txt │ │ │ ├── license.rst.txt │ │ │ ├── about.rst.txt │ │ │ ├── tutorial.rst.txt │ │ │ └── installation.rst.txt │ │ ├── search.html │ │ ├── py-modindex.html │ │ ├── license.html │ │ ├── genindex.html │ │ ├── index.html │ │ ├── searchindex.js │ │ └── about.html │ └── doctrees │ │ ├── about.doctree │ │ ├── index.doctree │ │ ├── using.doctree │ │ ├── license.doctree │ │ ├── modules.doctree │ │ ├── tutorial.doctree │ │ ├── environment.pickle │ │ └── installation.doctree ├── source │ ├── index.rst │ ├── modules.rst │ ├── license.rst │ ├── about.rst │ ├── conf.py │ ├── tutorial.rst │ └── installation.rst ├── Makefile └── make.bat ├── runtime.txt ├── Procfile ├── tutorial ├── CART-demo.zip ├── requirements.txt ├── special_functions.py └── config.yaml ├── helpers ├── __pycache__ │ ├── check_db.cpython-37.pyc │ ├── check_db.cpython-38.pyc │ ├── rephrase.cpython-37.pyc │ ├── rephrase.cpython-38.pyc │ ├── log_conversations.cpython-37.pyc │ ├── log_conversations.cpython-38.pyc │ ├── special_functions.cpython-37.pyc │ └── special_functions.cpython-38.pyc ├── special_functions.py ├── db_class.py ├── dialogflow_connector.py ├── check_db.py └── rephrase.py ├── requirements.txt ├── main.py ├── .readthedocs.yaml ├── LICENSE ├── README.md ├── config.yaml ├── config_example.yaml └── tasks.py /docs/cache.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.6.7 -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn -b '0.0.0.0:'$PORT --log-level INFO main:bot -------------------------------------------------------------------------------- /docs/build/html/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /tutorial/CART-demo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/tutorial/CART-demo.zip -------------------------------------------------------------------------------- /docs/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/objects.inv -------------------------------------------------------------------------------- /tutorial/requirements.txt: -------------------------------------------------------------------------------- 1 | microsoftbotframework 2 | pymysql 3 | apiai 4 | gunicorn 5 | vaderSentiment -------------------------------------------------------------------------------- /docs/build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/up.png -------------------------------------------------------------------------------- /docs/build/doctrees/about.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/about.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/using.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/using.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/down.png -------------------------------------------------------------------------------- /docs/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/file.png -------------------------------------------------------------------------------- /docs/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/build/doctrees/license.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/license.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/modules.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/modules.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/tutorial.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/tutorial.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/comment.png -------------------------------------------------------------------------------- /docs/build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/build/doctrees/installation.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/doctrees/installation.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/comment-close.png -------------------------------------------------------------------------------- /docs/build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /helpers/__pycache__/check_db.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/check_db.cpython-37.pyc -------------------------------------------------------------------------------- /helpers/__pycache__/check_db.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/check_db.cpython-38.pyc -------------------------------------------------------------------------------- /helpers/__pycache__/rephrase.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/rephrase.cpython-37.pyc -------------------------------------------------------------------------------- /helpers/__pycache__/rephrase.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/rephrase.cpython-38.pyc -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | microsoftbotframework 2 | google-cloud-dialogflow 3 | proto-plus 4 | pymysql 5 | apiai 6 | gunicorn 7 | vaderSentiment -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bold.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-italic.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-italic.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-italic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-regular.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-italic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-regular.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-regular.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /helpers/__pycache__/log_conversations.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/log_conversations.cpython-37.pyc -------------------------------------------------------------------------------- /helpers/__pycache__/log_conversations.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/log_conversations.cpython-38.pyc -------------------------------------------------------------------------------- /helpers/__pycache__/special_functions.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/special_functions.cpython-37.pyc -------------------------------------------------------------------------------- /helpers/__pycache__/special_functions.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/helpers/__pycache__/special_functions.cpython-38.pyc -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvacw/CART/HEAD/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 -------------------------------------------------------------------------------- /docs/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 2c135a4342daab493ab10b31e7da85fd 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from helpers.check_db import check_db 2 | check_db() 3 | 4 | 5 | from microsoftbotframework import MsBot 6 | from tasks import * 7 | 8 | import os 9 | 10 | bot = MsBot() 11 | bot.add_process(echo_response) 12 | # bot.add_process(send_to_conversation) 13 | 14 | if __name__ == '__main__': 15 | bot.run() -------------------------------------------------------------------------------- /helpers/special_functions.py: -------------------------------------------------------------------------------- 1 | # IMPORTING CONFIGURATIONS 2 | import yaml 3 | 4 | try: 5 | with open('config.yaml', 'r') as configfile: 6 | cfg = yaml.load(configfile) 7 | except: 8 | with open('../config.yaml', 'r') as configfile: 9 | cfg = yaml.load(configfile) 10 | 11 | 12 | def placeholder(): 13 | pass 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '1.00', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false 12 | }; -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Build documentation in the docs/ directory with Sphinx 9 | sphinx: 10 | configuration: docs/source/conf.py 11 | 12 | # Optionally build your docs in additional formats such as PDF 13 | formats: 14 | - pdf 15 | 16 | # Optionally set the version of Python and requirements required to build your docs 17 | python: 18 | version: 3.7 19 | install: 20 | - requirements: requirements.txt -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. CART - Conversational Agent Research Toolkit documentation master file, created by 2 | sphinx-quickstart on Wed Nov 14 13:22:39 2018. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Conversational Agent Research Toolkit (CART) 7 | ======================================================================== 8 | 9 | Guide 10 | ^^^^^ 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | about 15 | installation 16 | using 17 | modules 18 | tutorial 19 | license 20 | 21 | 22 | 23 | Indices and tables 24 | ================== 25 | 26 | * :ref:`genindex` 27 | * :ref:`modindex` 28 | * :ref:`search` 29 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = CART-ConversationalAgentResearchToolkit 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/build/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. CART - Conversational Agent Research Toolkit documentation master file, created by 2 | sphinx-quickstart on Wed Nov 14 13:22:39 2018. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Conversational Agent Research Toolkit (CART) 7 | ======================================================================== 8 | 9 | Guide 10 | ^^^^^ 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | about 15 | installation 16 | using 17 | modules 18 | tutorial 19 | license 20 | 21 | 22 | 23 | Indices and tables 24 | ================== 25 | 26 | * :ref:`genindex` 27 | * :ref:`modindex` 28 | * :ref:`search` 29 | -------------------------------------------------------------------------------- /tutorial/special_functions.py: -------------------------------------------------------------------------------- 1 | # IMPORTING CONFIGURATIONS 2 | import yaml 3 | 4 | try: 5 | with open('config.yaml', 'r') as configfile: 6 | cfg = yaml.load(configfile) 7 | except: 8 | with open('../config.yaml', 'r') as configfile: 9 | cfg = yaml.load(configfile) 10 | 11 | 12 | def placeholder(): 13 | pass 14 | 15 | 16 | ## EXAMPLE - SENTIMENT ANALYSIS 17 | from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer 18 | analyzer = SentimentIntensityAnalyzer() 19 | def check_sentiment(user_message): 20 | try: 21 | sentiment = analyzer.polarity_scores(user_message) 22 | sentiment = sentiment['compound'] 23 | return sentiment 24 | except: 25 | return None 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | .. CART - Conversational Agent Research Toolkit documentation master file, created by 2 | sphinx-quickstart on Wed Nov 14 13:22:39 2018. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | .. _modules: 7 | 8 | Modules 9 | ======================================================================== 10 | 11 | Note: see the :ref:`using` for more information on how to use these functions. 12 | 13 | check_db 14 | ^^^^^^^^ 15 | .. automodule:: helpers.check_db 16 | :members: 17 | 18 | 19 | log_conversations 20 | ^^^^^^^^^^^^^^^^^ 21 | .. automodule:: helpers.log_conversations 22 | :members: 23 | 24 | 25 | rephrase 26 | ^^^^^^^^^^^^^^^^^ 27 | .. automodule:: helpers.rephrase 28 | :members: 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /docs/build/html/_sources/modules.rst.txt: -------------------------------------------------------------------------------- 1 | .. CART - Conversational Agent Research Toolkit documentation master file, created by 2 | sphinx-quickstart on Wed Nov 14 13:22:39 2018. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | .. _modules: 7 | 8 | Modules 9 | ======================================================================== 10 | 11 | Note: see the :ref:`using` for more information on how to use these functions. 12 | 13 | check_db 14 | ^^^^^^^^ 15 | .. automodule:: helpers.check_db 16 | :members: 17 | 18 | 19 | log_conversations 20 | ^^^^^^^^^^^^^^^^^ 21 | .. automodule:: helpers.log_conversations 22 | :members: 23 | 24 | 25 | rephrase 26 | ^^^^^^^^^^^^^^^^^ 27 | .. automodule:: helpers.rephrase 28 | :members: 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /docs/build/html/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | set SPHINXPROJ=CART-ConversationalAgentResearchToolkit 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 20 | echo.installed, then set the SPHINXBUILD environment variable to point 21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 22 | echo.may add the Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 [ANONYMIZED] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/source/license.rst: -------------------------------------------------------------------------------- 1 | .. _license: 2 | 3 | License 4 | ======================================================================== 5 | 6 | MIT License 7 | 8 | Copyright (c) 2018 Theo Araujo 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/build/html/_sources/license.rst.txt: -------------------------------------------------------------------------------- 1 | .. _license: 2 | 3 | License 4 | ======================================================================== 5 | 6 | MIT License 7 | 8 | Copyright (c) 2018 Theo Araujo 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | -------------------------------------------------------------------------------- /helpers/db_class.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | 3 | try: 4 | with open('config.yaml', 'r') as configfile: 5 | cfg = yaml.load(configfile) 6 | except: 7 | with open('../config.yaml', 'r') as configfile: 8 | cfg = yaml.load(configfile) 9 | 10 | 11 | host = cfg['other']['database_url'] 12 | user = cfg['other']['database_username'] 13 | pwd = cfg['other']['database_password'] 14 | dbname = cfg['other']['database_name'] 15 | 16 | 17 | import pymysql 18 | 19 | class DB: 20 | conn = None 21 | 22 | def connect(self): 23 | self.conn = pymysql.connect(host=host, port=3306, user=user, passwd=pwd, db=dbname, charset = 'utf8mb4') 24 | 25 | def query(self, sql, attributes=None): 26 | try: 27 | cursor = self.conn.cursor() 28 | if attributes: 29 | cursor.execute(sql, attributes) 30 | else: 31 | cursor.execute(sql) 32 | except (AttributeError, pymysql.err.OperationalError): 33 | self.connect() 34 | cursor = self.conn.cursor() 35 | if attributes: 36 | cursor.execute(sql, attributes) 37 | else: 38 | cursor.execute(sql) 39 | return cursor 40 | 41 | def commit(self): 42 | try: 43 | self.conn.commit() 44 | except (AttributeError, pymysql.err.OperationalError): 45 | self.connect() 46 | self.conn.commit() 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CART - Conversational Agent Research Toolkit [DEPRECATED] 2 | 3 | ## Update 4 | Given changes in the underlying offering of services (e.g., Microsoft Bot Framework), CART may not be operational for new projects. This repository is being archived and the code can be reused by others as needed. 5 | 6 | ## About the project 7 | 8 | The Conversational Agent Research Toolkit (CART) is aimed at enabling researchers to create conversational agents for experimental studies using computational methods. CART provides a unifying toolkit written in Python that integrates existing services and APIs for dialogue management, natural language understanding & generation, and frameworks that enable publishing the conversational agents as either a web interface or within messaging apps. 9 | 10 | 11 | 12 | 13 | ## Requirements 14 | 15 | CART is written in Python 3.8, and needs run in a server able to execute Python code (serving a Flask application with an https certificate) and host a MySQL database. The [documentation](https://cart.readthedocs.io/en/latest/) demonstrates how to use Heroku (for the web server) and a database service (e.g., AWS RDS). 16 | 17 | CART requires also access to two API services: 18 | * [DialogFlow](https://dialogflow.com), for dialogue management 19 | * [Microsoft Bot Framework](https://dev.botframework.com/), to publish the agent online in a web chat or in other channels (e.g., Skype, Telegram, Facebook Messenger) 20 | 21 | Note: CART has been updated in May 2021 to reflect the new way to connect with DialogFlow's API. The DialogFlow credentials need to be set as environment variables (e.g., config vars). More information is available in the [documentation](https://cart.readthedocs.io/en/latest/installation.html#installation-setup-guide) (see steps 3 and 5). 22 | 23 | 24 | ## Installing and Using CART 25 | 26 | Documentation on how to install and use CART is available here: https://cart.readthedocs.io/en/latest/ 27 | -------------------------------------------------------------------------------- /helpers/dialogflow_connector.py: -------------------------------------------------------------------------------- 1 | import os, ast 2 | from google.cloud import dialogflow 3 | from google.oauth2.service_account import Credentials 4 | import json, proto 5 | 6 | 7 | def proto_message_to_dict(message: proto.Message) -> dict: 8 | """Helper method to parse protobuf message to dictionary.""" 9 | return json.loads(message.__class__.to_json(message)) 10 | 11 | 12 | def detect_intent_texts(session_id, text): 13 | '''Connects to DialogFlow using the environment variables 'DF_LANGUAGE_CODE' to determine the language code, 'DF_CREDENTIALS' for authentication. 14 | Credentials need to be stored as an environment variable. Before doing so, line-breaks need to be removed, and double-quotes turned into single-quotes. 15 | ''' 16 | 17 | try: 18 | language_code = os.environ['DF_LANGUAGE_CODE'] 19 | 20 | credentials = os.environ['DF_CREDENTIALS'] 21 | 22 | 23 | credentials = ast.literal_eval(credentials) 24 | 25 | project_id = credentials['project_id'] 26 | 27 | cr = Credentials.from_service_account_info(credentials) 28 | session_client = dialogflow.SessionsClient(credentials=cr) 29 | 30 | session = session_client.session_path(project_id, session_id) 31 | print('Session path: {}\n'.format(session)) 32 | 33 | text_input = dialogflow.TextInput( 34 | text=text, language_code=language_code) 35 | 36 | query_input = dialogflow.QueryInput(text=text_input) 37 | 38 | response = session_client.detect_intent( 39 | request={'session': session, 'query_input': query_input}) 40 | 41 | 42 | response = proto_message_to_dict(response.query_result) 43 | except Exception as e: 44 | response = 'DialogFlow error: ' + str(e) 45 | 46 | return response 47 | 48 | if __name__ == '__main__': 49 | bot_code = 'TEST2' 50 | session_id = '1223455' 51 | text = 'Hello' 52 | language_code = 'EN' 53 | print(detect_intent_texts(session_id, text, bot_code)) 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /tutorial/config.yaml: -------------------------------------------------------------------------------- 1 | other: 2 | app_client_id: <> 3 | app_client_secret: <> 4 | database_url: <> 5 | database_name: <> 6 | database_username: <> 7 | database_password: <> 8 | dialogflow_access_token: <> 9 | conversationcode_suffix: B 10 | conversationcode_base: 1500 11 | 12 | experimental_design: 13 | assignment_manager: CART 14 | assignment_method: random_balanced 15 | conditions: 16 | condition_1: 17 | condition_name: machine 18 | condition_2: 19 | condition_name: humanlike 20 | 21 | rephrases: 22 | condition_1: 23 | AGENTNAME: NutriBot 24 | ACKNOWLEDGEMENT1: OK. The system needs some information about you before it can make a recommendation. 25 | ACKNOWLEDGEMENT2: OK. 26 | ACKNOWLEDGEMENT3: OK, and 27 | RECOMMENDATION: OK. Based on the your answers, the recommended breakfast is 28 | CLOSURESTART: Thank you. 29 | CLOSUREEND: Conversation ended. 30 | condition_2: 31 | AGENTNAME: Ben 32 | ACKNOWLEDGEMENT1: Great! Let's get started then. I need to know a bit more about you before I can make a suggestion. 33 | ACKNOWLEDGEMENT2: Gotcha! 34 | ACKNOWLEDGEMENT3: Cool! And, just between the two of us 35 | RECOMMENDATION: Thanks! Hey... so here's an idea for your breakfast... 36 | CLOSURESTART: OK! Thanks a million for chatting with me! 37 | CLOSUREEND: Have a great day! 38 | 39 | 40 | connect_intents: 41 | PARTICIPANTID_VALID: START_EXPERIMENT 42 | 43 | 44 | questionnaire_flow: 45 | enabled: True 46 | moment: during 47 | config_during: 48 | participantid_dialog_field: participantid 49 | participantid_not_recognized: PARTICIPANTID_INVALID 50 | participantid_recognized: PARTICIPANTID_VALID 51 | participantid_valid_suffixes: A 52 | 53 | 54 | special_functions: 55 | function_1: 56 | function_name: check_sentiment 57 | store_output: logs 58 | store_output_field: sentiment 59 | store_output_field_type: float 60 | function_action: False 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docs/build/html/_static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/build/html/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} -------------------------------------------------------------------------------- /docs/source/about.rst: -------------------------------------------------------------------------------- 1 | .. _about: 2 | 3 | About CART 4 | ======================================================================== 5 | 6 | Objectives 7 | ^^^^^^^^^^ 8 | The Conversational Agent Research Toolkit (CART) aims at enabling researchers to create conversational agents for experimental studies using computational methods. CART provides a unifying toolkit written in Python that integrates existing services and APIs for dialogue management, natural language understanding & generation, and frameworks that enable publishing the conversational agents as either a web interface or within messaging apps. Specifically developed for communication research, CART not only acts as an integration layer across these different services, but also aims to provides a configurable solution meeting the requirements of academic research. 9 | 10 | Components 11 | ^^^^^^^^^^ 12 | 13 | CART acts as an integration layer between several services so it can generate a conversational agent that can interact with participants of an experiment, log the conversations, design experiments, and connect with questionnaires for self-reported measures. To do so, CART works with the following components: 14 | 15 | 16 | Dialogue Management 17 | ################### 18 | 19 | CART currently uses `DialogFlow `_ as the primary tool to handle dialogue managemnt. This means that all the participant input, and the responses that the agent gives, are primarily setup in DialogFlow. Using specific tokens (see below), the researcher can customise the responses that the agent provides depending on the condition that the participant is in. 20 | 21 | 22 | Agent Publication 23 | ################# 24 | 25 | CART currently uses the `Microsoft Azure Bot Channel Registration `_ to publish the conversational agent. Within CART, the Bot Framework is responsible for creating a webchat for users to chat with the agent. This webchat can be embedded in online surveys. The Bot Framework also allows the agent to be published in other channels (e.g., Skype, Telegram, Facebook Messenger) without needing to change the code within CART. 26 | 27 | 28 | Conversation Logging 29 | #################### 30 | 31 | One of the key aspects of CART is the ability to log the conversations that participants in an experiment have with the agent. To do so, CART connects to a database under the control of the researcher. 32 | 33 | 34 | Experiment Design 35 | ################# 36 | 37 | CART allows the researcher to create experiments in which the same agent acts in different ways depending on the condition that the participant is in. To do so, the researcher simply needs to add specific tokens in the Dialogue Management tool, and setup different conditions within CART itself. 38 | 39 | 40 | Online Questionnaire Integration 41 | ################################ 42 | 43 | After an agent is created and published, the researcher can integrate it to the flow of an online questionnaire (e.g., Qualtrics, SurveyMonkey). By turning on the *questionnaire flow*, the agent requests a unique ID from the participant, and returns a unique conversation code at the end of the conversation, so the researcher can link the conversation logs in the CART database with the responses in the online questionnaire. -------------------------------------------------------------------------------- /docs/build/html/_sources/about.rst.txt: -------------------------------------------------------------------------------- 1 | .. _about: 2 | 3 | About CART 4 | ======================================================================== 5 | 6 | Objectives 7 | ^^^^^^^^^^ 8 | The Conversational Agent Research Toolkit (CART) aims at enabling researchers to create conversational agents for experimental studies using computational methods. CART provides a unifying toolkit written in Python that integrates existing services and APIs for dialogue management, natural language understanding & generation, and frameworks that enable publishing the conversational agents as either a web interface or within messaging apps. Specifically developed for communication research, CART not only acts as an integration layer across these different services, but also aims to provides a configurable solution meeting the requirements of academic research. 9 | 10 | Components 11 | ^^^^^^^^^^ 12 | 13 | CART acts as an integration layer between several services so it can generate a conversational agent that can interact with participants of an experiment, log the conversations, design experiments, and connect with questionnaires for self-reported measures. To do so, CART works with the following components: 14 | 15 | 16 | Dialogue Management 17 | ################### 18 | 19 | CART currently uses `DialogFlow `_ as the primary tool to handle dialogue managemnt. This means that all the participant input, and the responses that the agent gives, are primarily setup in DialogFlow. Using specific tokens (see below), the researcher can customise the responses that the agent provides depending on the condition that the participant is in. 20 | 21 | 22 | Agent Publication 23 | ################# 24 | 25 | CART currently uses the `Microsoft Azure Bot Channel Registration `_ to publish the conversational agent. Within CART, the Bot Framework is responsible for creating a webchat for users to chat with the agent. This webchat can be embedded in online surveys. The Bot Framework also allows the agent to be published in other channels (e.g., Skype, Telegram, Facebook Messenger) without needing to change the code within CART. 26 | 27 | 28 | Conversation Logging 29 | #################### 30 | 31 | One of the key aspects of CART is the ability to log the conversations that participants in an experiment have with the agent. To do so, CART connects to a database under the control of the researcher. 32 | 33 | 34 | Experiment Design 35 | ################# 36 | 37 | CART allows the researcher to create experiments in which the same agent acts in different ways depending on the condition that the participant is in. To do so, the researcher simply needs to add specific tokens in the Dialogue Management tool, and setup different conditions within CART itself. 38 | 39 | 40 | Online Questionnaire Integration 41 | ################################ 42 | 43 | After an agent is created and published, the researcher can integrate it to the flow of an online questionnaire (e.g., Qualtrics, SurveyMonkey). By turning on the *questionnaire flow*, the agent requests a unique ID from the participant, and returns a unique conversation code at the end of the conversation, so the researcher can link the conversation logs in the CART database with the responses in the online questionnaire. -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | other: 2 | app_client_id: <> 3 | app_client_secret: <> 4 | database_url: <> 5 | database_name: <> 6 | database_username: <> 7 | database_password: <> 8 | conversationcode_suffix: < 9 | conversationcode_base: <> 10 | 11 | 12 | ## NOTE: Code below can be commented/uncommented when used. See documentation. 13 | 14 | 15 | experimental_design: 16 | # assignment_manager: CART 17 | # assignment_method: <> 18 | # conditions: 19 | # condition_1: 20 | # condition_name: <> 21 | # condition_2: 22 | # condition_name: <> 23 | 24 | assignment_manager: SURVEY 25 | assignment_method: participantid 26 | conditions: 27 | condition_1: 28 | condition_name: <> 29 | condition_suffix: <> 30 | condition_2: 31 | condition_name: <> 32 | condition_suffix: <> 33 | 34 | 35 | 36 | 37 | rephrases: 38 | all_conditions: 39 | STANDARDWELCOMEMESSAGE: This is the text that the agent should reply when there is a contact relation update (i.e., agent is added to Skype). 40 | PROVIDECONVERSATIONCODE: Good bye! Your conversation code is |CONVERSATIONCODE|. 41 | # condition_1: 42 | # EXAMPLE1: This is the text for condition_1 (control). 43 | # condition_2: 44 | # EXAMPLE1: This is the text for condition_2 (treatment). 45 | 46 | 47 | # overrides: 48 | # override_1: 49 | # override_reason: quit 50 | # override_terms_case_sensitive: False 51 | # override_terms_matching: full_string 52 | # override_terms_in_user_message: bye, good bye, end, quit, stop 53 | # override_response_from_agent: '[PROVIDECONVERSATIONCODE]' 54 | 55 | # connect_intents: 56 | # PARTICIPANTID_VALID: START_EXPERIMENT 57 | 58 | 59 | questionnaire_flow: 60 | enabled: True 61 | moment: <> 62 | config_before: 63 | rephrase_token: SENDTOSURVEY 64 | rephrase_text: <> 65 | config_during: 66 | rephrase_start_token: VALIDATEPARTICIPANTID 67 | participantid_dialog_field: participantid 68 | participantid_not_recognized: PARTICIPANTID_INVALID 69 | participantid_valid_suffixes: <> 70 | rephrase_end_token: SENDTOSURVEY 71 | rephrase_end_text: <> 72 | config_after: 73 | rephrase_start_token: VALIDATEPARTICIPANTID 74 | participantid_dialog_field: participantid 75 | participantid_not_recognized: PARTICIPANTID_INVALID 76 | participantid_valid_suffixes: <> 77 | 78 | 79 | special_functions: 80 | function_1: 81 | function_name: <> 82 | store_output: logs 83 | store_output_field: <> 84 | store_output_field_type: <> 85 | function_action: <> 86 | function_comparison: <> 87 | function_comparison_met: <> 88 | -------------------------------------------------------------------------------- /config_example.yaml: -------------------------------------------------------------------------------- 1 | other: 2 | app_client_id: <> 3 | app_client_secret: <> 4 | database_url: <> 5 | database_name: <> 6 | database_username: <> 7 | database_password: <> 8 | conversationcode_suffix: < 9 | conversationcode_base: <> 10 | 11 | 12 | ## NOTE: Code below can be commented/uncommented when used. See documentation. 13 | 14 | 15 | experimental_design: 16 | # assignment_manager: CART 17 | # assignment_method: <> 18 | # conditions: 19 | # condition_1: 20 | # condition_name: <> 21 | # condition_2: 22 | # condition_name: <> 23 | 24 | assignment_manager: SURVEY 25 | assignment_method: participantid 26 | conditions: 27 | condition_1: 28 | condition_name: <> 29 | condition_suffix: <> 30 | condition_2: 31 | condition_name: <> 32 | condition_suffix: <> 33 | 34 | 35 | 36 | 37 | rephrases: 38 | all_conditions: 39 | STANDARDWELCOMEMESSAGE: This is the text that the agent should reply when there is a contact relation update (i.e., agent is added to Skype). 40 | PROVIDECONVERSATIONCODE: Good bye! Your conversation code is |CONVERSATIONCODE|. 41 | # condition_1: 42 | # EXAMPLE1: This is the text for condition_1 (control). 43 | # condition_2: 44 | # EXAMPLE1: This is the text for condition_2 (treatment). 45 | 46 | 47 | # overrides: 48 | # override_1: 49 | # override_reason: quit 50 | # override_terms_case_sensitive: False 51 | # override_terms_matching: full_string 52 | # override_terms_in_user_message: bye, good bye, end, quit, stop 53 | # override_response_from_agent: '[PROVIDECONVERSATIONCODE]' 54 | 55 | # connect_intents: 56 | # PARTICIPANTID_VALID: START_EXPERIMENT 57 | 58 | 59 | questionnaire_flow: 60 | enabled: True 61 | moment: <> 62 | config_before: 63 | rephrase_token: SENDTOSURVEY 64 | rephrase_text: <> 65 | config_during: 66 | rephrase_start_token: VALIDATEPARTICIPANTID 67 | participantid_dialog_field: participantid 68 | participantid_not_recognized: PARTICIPANTID_INVALID 69 | participantid_valid_suffixes: <> 70 | rephrase_end_token: SENDTOSURVEY 71 | rephrase_end_text: <> 72 | config_after: 73 | rephrase_start_token: VALIDATEPARTICIPANTID 74 | participantid_dialog_field: participantid 75 | participantid_not_recognized: PARTICIPANTID_INVALID 76 | participantid_valid_suffixes: <> 77 | 78 | 79 | special_functions: 80 | function_1: 81 | function_name: <> 82 | store_output: logs 83 | store_output_field: <> 84 | store_output_field_type: <> 85 | function_action: <> 86 | function_comparison: <> 87 | function_comparison_met: <> 88 | -------------------------------------------------------------------------------- /docs/build/html/_static/js/html5shiv-printshiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /helpers/check_db.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | 3 | 4 | try: 5 | with open('config.yaml', 'r') as configfile: 6 | cfg = yaml.load(configfile) 7 | except: 8 | with open('../config.yaml', 'r') as configfile: 9 | cfg = yaml.load(configfile) 10 | 11 | 12 | host = cfg['other']['database_url'] 13 | user = cfg['other']['database_username'] 14 | pwd = cfg['other']['database_password'] 15 | dbname = cfg['other']['database_name'] 16 | 17 | 18 | import pymysql 19 | 20 | def get_special_fields(): 21 | special_functions = cfg['special_functions'] 22 | special_fields_logs = {} 23 | special_fields_conversations = {} 24 | for spfunc in special_functions.values(): 25 | if spfunc['store_output'] == 'logs': 26 | special_fields_logs[spfunc['store_output_field']] = spfunc['store_output_field_type'] 27 | if spfunc['store_output'] == 'conversations': 28 | special_fields_conversations[spfunc['store_output_field']] = spfunc['store_output_field_type'] 29 | 30 | return special_fields_logs, special_fields_conversations 31 | 32 | 33 | 34 | def create_logs(cur): 35 | try: 36 | special_fields_logs, special_fields_conversations = get_special_fields() 37 | except: 38 | special_fields_logs = {} 39 | special_fields_conversations = {} 40 | 41 | sql_start = '''CREATE TABLE `logs` ( 42 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 43 | `timestamp` datetime, 44 | `event` text, 45 | `participantID` text, 46 | `text` text, 47 | `message` text, 48 | `userData` text, 49 | `conversationid` text, 50 | `conversationid_trunc` text, 51 | `response_diag` text,''' 52 | sql_end = ''' PRIMARY KEY (`id`) 53 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;''' 54 | 55 | if len(special_fields_logs.keys()) > 0: 56 | for field_name, field_type in special_fields_logs.items(): 57 | sql_start += ' `'+field_name+'` '+str(field_type)+', ' 58 | sql = sql_start + sql_end 59 | cur.execute(sql) 60 | 61 | 62 | print('check_db: creating table logs') 63 | 64 | def create_conversations(cur): 65 | try: 66 | special_fields_logs, special_fields_conversations = get_special_fields() 67 | except: 68 | special_fields_logs = {} 69 | special_fields_conversations = {} 70 | 71 | sql_start = ''' 72 | CREATE TABLE `conversations` ( 73 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 74 | `conversationid` text, 75 | `conversationid_trunc` text, 76 | `conversation_code` text, 77 | `status` text, 78 | `turns` int(11) DEFAULT '0', 79 | `initial_message` text, 80 | `first_name` text, 81 | `participantid` text, 82 | `conditionid` text,''' 83 | 84 | sql_end = ''' PRIMARY KEY (`id`) 85 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; 86 | ''' 87 | if len(special_fields_conversations.keys()) > 0: 88 | for field_name, field_type in special_fields_conversations.items(): 89 | sql_start += ' `'+field_name+'` '+str(field_type)+', ' 90 | sql = sql_start + sql_end 91 | 92 | 93 | cur.execute(sql) 94 | 95 | print('check_db: creating table conversations') 96 | 97 | 98 | def check_db(): 99 | """Connects to the databse informed in the configuration file and checks whether all tables are created. If tables are missing, it creates the tables. Does not return any values.""" 100 | conn = pymysql.connect(host=host, port=3306, user=user, passwd=pwd, db=dbname, charset = 'utf8mb4') 101 | cur = conn.cursor() 102 | 103 | # Checking whether tables are created 104 | cur.execute('SHOW TABLES') 105 | tables = cur.fetchall() 106 | if len(tables) == 0: 107 | try: 108 | create_logs(cur) 109 | conn.commit() 110 | except Exception as e: 111 | print(e) 112 | try: 113 | create_conversations(cur) 114 | conn.commit() 115 | except Exception as e: 116 | print(e) 117 | 118 | return 119 | 120 | else: 121 | cur.execute('SHOW TABLES') 122 | tables = cur.fetchall() 123 | tables = [item[0] for item in tables] 124 | print(tables) 125 | if 'logs' not in tables: 126 | create_logs(cur) 127 | conn.commit() 128 | cur.execute('SHOW TABLES') 129 | tables = cur.fetchall() 130 | tables = [item[0] for item in tables] 131 | if 'conversations' not in tables: 132 | create_conversations(cur) 133 | conn.commit() 134 | print('check_db: all tables required available') 135 | return 136 | 137 | -------------------------------------------------------------------------------- /docs/build/html/_static/js/theme.js: -------------------------------------------------------------------------------- 1 | !function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("
"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}t.length>0&&($(".wy-menu-vertical .current").removeClass("current"),t.addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l1").parent().addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l2").addClass("current"),t.closest("li.toctree-l3").addClass("current"),t.closest("li.toctree-l4").addClass("current"),t.closest("li.toctree-l5").addClass("current"),t[0].scrollIntoView())}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t