{ "info": { "author": "Matthew Vielkind", "author_email": "matt@righthandcode.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# otto-bot\n\notto-bot is a helper utility for deploying chatbots using Twilio's Autopilot. With otto-bot you can configure your\nchatbots locally and on deployment all of the API calls to setup the bot are handled for you. While I know Twilio has \nits own CLI utility, the primary motivation for this library was to help me learn more about Autopilot and how to deploy\npackages to PyPi. otto-bot is the outcome of that learning experience that I hope others may find beneficial as \nwell!\n\nThe library won't handle all features of building an Autopilot bot. For instance, there is not an API (at least that I\nknow of) for deploying custom Twilio Runtime Functions, so those will have to be deployed via the Twilio Console. I'm \ngoing to try to keep up with changes to the Twilio API, changes in the API could impact performance. While working\nthrough this project I identified a bunch of cool features to add-on that I'm planning on, so look forward to some\nfuture updates!\n\n\n## Getting Started\n\nTo use otto-bot you must have a Twilio account with your Twilio account credentials setup as environmental \nvariables. You can find information about signing up for Twilio [here](https://www.twilio.com/docs/sms/tutorials/how-to-send-sms-messages-python)\nand setting up your environmental variables [here](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html).\n\nOnce you have your Twilio account setup, otto-bot can be installed via `pip`:\n\n```bash\npip install otto-bot\n```\n\notto-bot is only configured to work with Python 3.6 and above. If you have both a Python 2 and Python 3 version \ninstalled you might need to run the command above using `pip3` instead of `pip`.\n\nNow you're ready to go!\n\n## Configuring your Chatbot\nThe core of otto-bot is the JSON file defining your chatbot. The content of your input file will instruct otto-bot\nhow to deploy your bot to Twilio. To get started you started there is an `init` command that will generate an empty\nJSON file with placeholders for some of the more common elements your chatbot might use.\n\n```bash\notto-bot init\n```\n\nBy default the `init` command will include a placeholder for model, field type, task, and model build elements. These\nbasic settings are enough to get you started with building your chatbot. How you structure your JSON is influenced by\nthe Twilio API model itself, so I've included links for where you can get more information about each setting as well as\nmore advanced settings you can add to the JSON file.\n\n### Basic Settings- assistant\nEach bot is defined by a single assistant object. The assistant object is required for each bot as it is the core\nobject all the other components will be linked to to create the bot. The assistant object contains metadata about your\nbot and some of the default behaviors.\n\n```\n{\n \"assistant\": {\n \"unique_name\": \"\", # Required. A name to uniquely identify your bot.\n \"friendly_name\": \"\", # Optional. A more descriptive name defining the bot.\n \"defaults\": { # Optional. Assigns default actions.\n \"defaults\": {\n \"assistant_initiation\": \"\", # Only used in voice messages to provide a greeting for inbound messages.\n \"fallback\": \"\", # How to respond if input can't be routed to a task.\n \"collect\": {\n \"validate_on_failure\": \"\" # What to do if there is an error collecting user input.\n }\n }\n }\n }\n}\n```\n\nExtra information about settings for the Assistant settings can be found in the [Twilio Assistant Resource](https://www.twilio.com/docs/autopilot/api/assistant)\n\n### Basic Settings- field_type\nAs a part of your chatbot you can define custom fields that are extracted from the user's input. A chatbot does not\nrequire you to include a field_type, but a chatbot can include multiple different custom field_types.\nIn the configuration file each field_type is defined with a prefix \"field_type__\" and must be uniquely named. An\nexample definition is below:\n\n```\n{\n \"field_type__your_custom_field\": {\n \"unique_name\": \"\", # Required. Unique name identifying your custom field type.\n \"friendly_name\": \"\", # Optional. A more descriptive name defining the field type. \n \"values\": [] # Required. A list of values defining the field.\n }\n}\n```\n\nYou can find further details about this settings here: [Twilio FieldType Resource](https://www.twilio.com/docs/autopilot/api/field-type)\n\n### Basic Settings- tasks\nTasks are the core of what dictates how your chatbot will interact with messages. Your chatbot must contain at least\none task. In the JSON file each a task is defined with the \"task__\" prefix and contains the following information:\n\n```\n{\n \"task__your_task\": {\n \"unique_name\": \"\", # Required. Unique name identifying the task.\n \"friendly_name\": \"\", # Optional. Most descriptive name defining the task.\n \"actions\": { # Required. A list of actions your task should take.\n \"actions\": []\n },\n \"task_fields\": [ # Optional. If your task uses custom fields you must define them here.\n {\n \"unique_name\": \"\", # Required. Unique name identifying the field for the task.\n \"field_type\": \"\" # Required. Field type to assign to the field. Could be custom, or a Twilio default field.\n }\n ],\n \"samples\": [] # Required. List of key phrases that will trigger this task.\n }\n}\n```\n\nMore details about these settings and additional settings are here: [Twilio Task Resource](https://www.twilio.com/docs/autopilot/api/task).\n\n### Basic Settings- model\nThe last component of the JSON file is the \"model\". The most build component tells Twilio to build the actual model \nusing everything defined in the rest of the JSON file.\n\n```\n{\n \"model\": {\n \"unique_name\": \"\" # Required. Unique name to identify the model.\n }\n}\n```\n\nSee here for extra details: [Twilio ModelBuild Resource](https://www.twilio.com/docs/autopilot/api/model-build).\n\n\n## Deploying your Chatbot\nOnce you've defined your chatbot in the JSON file you can deploy the chatbot to Twilio with the following:\n\n```bash\notto-bot deploy chatbot-config.json [--overwrite]\n```\n\nThe `deploy` command reads the configuration JSON and will make all the API calls that are required. By default\notto-bot will deploy the bot exactly as defined in your JSON. If you have a chatbot that already exists all associated\nresources with the chatbot will be deleted and replaced with the resources currently defined in the JSON file. You can\nuse the `--overwrite` option to automatically overwrite an existing bot. Otherwise you will be prompted during\ndeployment to agree to overwrite the existing bot.\n\nBefore deploying the bot a number of validation checks are run on the input file to ensure there are no errors. These\nchecks ensure that your bot will successfully deploy without an error before anything starts to get deleted. In \naddition to doing the error checking alerts will be raised about best practices that aren't necessarily errors, but\nthat could help improve your bot. These checks will capture many common errors, but are not entirely robust. As new\nerrors are discovered I'll keep these validation checks up-to-date.\n\n### Deployment Limitations\notto-bot handles a lot, but not all aspects of your bot's deployment. Twilio currently does not have an API for \ndeploying custom Runtime functions. If you want to include a custom Runtime function with your bot you will need\nto define that function through the Twilio console.\n\nA second limitation is that once your bot is deployed you will have to go into the Twilio console and attach your\nbot to the channel you would like to deploy to.\n\n\n## Deleting a Chatbot\nSo, you've deployed a chatbot and don't want to use it anymore, the `teardown` command will delete your bot and all\nthe resources associated with it.\n\n```bash\notto-bot teardown unique_name\n```\n\nYou can call the `teardown` command along with the unique_name of the bot you want to delete and your bot will be\ndeleted.\n\n\n## Getting Started- Examples\n\nIn the [examples](https://github.com/mvielkind/otto-bot/tree/master/examples) directory there is a worked \nexample using the Twilio [Deep Table Autopilot Tutorial](https://www.twilio.com/docs/autopilot/tutorials/deep-table-restaurant-assistant)\n, demonstrating how otto-bot can be utilized.\n\n\n## What's Next\nI've learned a lot about Twilio Autopilot through this process. From this process there are a number of initial \nenhancements I want to add. If there is any other functionality you'd like to see let me know and I'll make sure it\ngets added!\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mvielkind/otto-bot", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "otto-bot", "package_url": "https://pypi.org/project/otto-bot/", "platform": "", "project_url": "https://pypi.org/project/otto-bot/", "project_urls": { "Homepage": "https://github.com/mvielkind/otto-bot" }, "release_url": "https://pypi.org/project/otto-bot/0.0.3/", "requires_dist": [ "twilio (==6.26.1)", "click (==7)" ], "requires_python": ">=3.6", "summary": "", "version": "0.0.3" }, "last_serial": 5329329, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8269abf33e45146dc0eaf1459d57ba27", "sha256": "1aa2815573ab3f7f358583d9497f2b9e94ff0abf9699474d95b9415651eca7b4" }, "downloads": -1, "filename": "otto_bot-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8269abf33e45146dc0eaf1459d57ba27", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 16418, "upload_time": "2019-05-28T22:11:29", "url": "https://files.pythonhosted.org/packages/cf/d4/fd55124a87c3afe6078754011d37ba0f3b234ab1beac5d9253ad763da075/otto_bot-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b0a545d04c98aa65d9d503d3d3016f87", "sha256": "51f4f5b740e49400fdd58e2047b6f68336ed0a45ae8752fab2136a43e1bc1b39" }, "downloads": -1, "filename": "otto-bot-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b0a545d04c98aa65d9d503d3d3016f87", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14628, "upload_time": "2019-05-28T22:11:31", "url": "https://files.pythonhosted.org/packages/f4/bd/30019cfbeec67691c0fdaba3f6bcc8c1bed2f5ce41b8757042c24b910481/otto-bot-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "c06c38d09c7f27ba6db53d11c30c9959", "sha256": "e1d487b9329f567c5dffbe2e145d49b5aba435c1a1103626e37f431234e6539f" }, "downloads": -1, "filename": "otto_bot-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c06c38d09c7f27ba6db53d11c30c9959", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 16414, "upload_time": "2019-05-28T22:17:04", "url": "https://files.pythonhosted.org/packages/15/99/16959bbfb20dc7fe2ed9c877efb72115aae3eaf7a04e4b3728124070e80f/otto_bot-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b5029940a51d949ead5e909a82a73f47", "sha256": "4345f242a08cb068460c2c7f8b51f7c425e5054c689a00b8a69cb61746677b8c" }, "downloads": -1, "filename": "otto-bot-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b5029940a51d949ead5e909a82a73f47", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14621, "upload_time": "2019-05-28T22:17:06", "url": "https://files.pythonhosted.org/packages/ea/7a/1ea2d14ddf73abfcbcc0d5debaafc8c9470e1fe9be6441370635fb5ec264/otto-bot-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "d26f4a2a1e03d088a7bb9db38d856514", "sha256": "79253d0e3abfda70788c0e09bc4d9e0b737809c4620e51f486655fb0e99ae94f" }, "downloads": -1, "filename": "otto_bot-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d26f4a2a1e03d088a7bb9db38d856514", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 16420, "upload_time": "2019-05-28T22:23:47", "url": "https://files.pythonhosted.org/packages/de/d8/2822529d817b782fdbfbcd9b93a83408c66fe31c497947225ae6f0428328/otto_bot-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c80e9c4721cd5362b131ab085ff94c25", "sha256": "49302f83e4c140f3fb6b0a6e2f8631813bad88d6a18ff0f1753dc4eea3463c05" }, "downloads": -1, "filename": "otto-bot-0.0.3.tar.gz", "has_sig": false, "md5_digest": "c80e9c4721cd5362b131ab085ff94c25", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14639, "upload_time": "2019-05-28T22:23:49", "url": "https://files.pythonhosted.org/packages/de/43/6ff7ec5ae7f17e7b8cfdc561163f61d6c53621bc2b29681ec310303cec4d/otto-bot-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d26f4a2a1e03d088a7bb9db38d856514", "sha256": "79253d0e3abfda70788c0e09bc4d9e0b737809c4620e51f486655fb0e99ae94f" }, "downloads": -1, "filename": "otto_bot-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d26f4a2a1e03d088a7bb9db38d856514", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 16420, "upload_time": "2019-05-28T22:23:47", "url": "https://files.pythonhosted.org/packages/de/d8/2822529d817b782fdbfbcd9b93a83408c66fe31c497947225ae6f0428328/otto_bot-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c80e9c4721cd5362b131ab085ff94c25", "sha256": "49302f83e4c140f3fb6b0a6e2f8631813bad88d6a18ff0f1753dc4eea3463c05" }, "downloads": -1, "filename": "otto-bot-0.0.3.tar.gz", "has_sig": false, "md5_digest": "c80e9c4721cd5362b131ab085ff94c25", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14639, "upload_time": "2019-05-28T22:23:49", "url": "https://files.pythonhosted.org/packages/de/43/6ff7ec5ae7f17e7b8cfdc561163f61d6c53621bc2b29681ec310303cec4d/otto-bot-0.0.3.tar.gz" } ] }