https://github.com/treethought/delivery-assistant
https://github.com/treethought/delivery-assistant
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/treethought/delivery-assistant
- Owner: treethought
- License: bsd-3-clause
- Created: 2017-05-31T07:12:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T22:59:31.000Z (about 9 years ago)
- Last Synced: 2025-02-06T12:48:24.130Z (over 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
MealClub Delivery Assistant
===============================
A Google Asisstant App to help MealCLub Drivers drive hands-free
Setup
-----
API.AI and Server Configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Create a new Agent within the `API.AI Console_`
2. Click "Fullfillment" left side menu and enable webhook
3. With `ngrok`_ installed:
.. code-block:: bash
./ngrok http 5000
3. Copy the **Forwarding https** url and paste it as the webhook URL in the "Fullfillment" menu
Project Environment
^^^^^^^^^^^^^^^^^^^
It is recommended to use a virtual environment
1. Clone and move into project directory
.. code-block:: bash
git clone https://github.com/treethought/Delivery-Assistant
cd MealClub Delivery Assistant
2. Within the `API.AI Console_`, click the "gear" icon next to the API.AI agent name.
3. Locate the Client and Developer access tokens under `API keys`
4. Set the Client and Developer Access token environment variables
.. code-block:: bash
export CLIENT_ACCESS_TOKEN='YOUR CLIENT ACCESS TOKEN'
export DEV_ACCESS_TOKEN='YOUR DEVELOPER ACCESS TOKEN'
5. Set the ``FLASK_APP`` and ``FLASK_DEBUG`` environment variables
.. code-block:: bash
export FLASK_APP=autoapp.py
export FLASK_DEBUG=1
6. Install requirements
.. code-block:: bash
pip install -r requirements.txt
Development
-----------
Register Assistant Schema with API.AI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
First update the `templates/` directory as needed and then run
.. code-block:: bash
schema assistant/webhook.py
Running the Flask App
^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
flask run
Testing the Assistant from the Command Line
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To quickly send queries to your agent and view the responses:
.. code-block:: bash
query assistant/webhook.py
Deployment
----------
In your production environment, make sure the ``FLASK_DEBUG`` environment
variable is unset or is set to ``0``, so that ``ProdConfig`` is used.
Heroku
^^^^^^
Create Heroku app
.. code-block:: bash
heroku create Delivery-Assistant
git remote add stage git@heroku.com:Delivery-Assistant.git
Configure Heroku app
.. code-block:: bash
heroku config:set CLIENT_ACCESS_TOKEN='YOUR CLIENT ACCESS TOKEN' -r stage
Deploy
Commit and push changes
.. code-block:: bash
git push stage master
.. _`API.AI Console`: https://console.api.ai/api-client/#/login
.. _`ngrok`: https://ngrok.com/