|
| 1 | +Create Virtual Assistants with Python |
| 2 | +===================================== |
| 3 | + |
| 4 | +[](https://pypi.python.org/pypi/flask-assistant) |
| 5 | +[](https://travis-ci.org/treethought/flask-assistant)  [](https://discord.gg/m6YHGyJ) |
| 6 | + |
| 7 | +A flask extension serving as a framework to easily create virtual assistants using [Dialogflow](https://dialogflow.com/docs) which may be integrated |
| 8 | +with platforms such as [Actions on |
| 9 | +Google](https://developers.google.com/actions/develop/apiai/) (Google |
| 10 | +Assistant). |
| 11 | + |
| 12 | +Flask-Assistant allows you to focus on building the core business logic |
| 13 | +of conversational user interfaces while utilizing Dialogflow's Natural |
| 14 | +Language Processing to interact with users. |
| 15 | + |
| 16 | +**Now supports Dialogflow V2!** |
| 17 | + |
| 18 | +This project is heavily inspired and based on John Wheeler's |
| 19 | +[Flask-ask](https://github.com/johnwheeler/flask-ask) for the Alexa |
| 20 | +Skills Kit. |
| 21 | + |
| 22 | +Features |
| 23 | +-------- |
| 24 | + |
| 25 | +> - Mapping of user-triggered Intents to action functions |
| 26 | +> - Context support for crafting dialogue dependent on the user's requests |
| 27 | +> - Define prompts for missing parameters when they are not present in the users request or past active contexts |
| 28 | +> - A convenient syntax resembling Flask's decoratored routing |
| 29 | +> - Rich Responses for Google Assistant |
| 30 | +
|
| 31 | +Hello World |
| 32 | +----------- |
| 33 | + |
| 34 | +```python |
| 35 | +from flask import Flask |
| 36 | +from flask_assistant import Assistant, ask |
| 37 | + |
| 38 | +app = Flask(__name__) |
| 39 | +assist = Assistant(app, project_id='GOOGLE_CLOUD_PROJECT_ID') |
| 40 | + |
| 41 | +@assist.action('Demo') |
| 42 | +def hello_world(): |
| 43 | + speech = 'Microphone check 1, 2 what is this?' |
| 44 | + return ask(speech) |
| 45 | + |
| 46 | +if __name__ == '__main__': |
| 47 | + app.run(debug=True) |
| 48 | +``` |
| 49 | + |
| 50 | +How-To |
| 51 | +------ |
| 52 | + |
| 53 | +> 1. Create an Assistant object with a Flask app. |
| 54 | +> 2. Use action decorators to map intents to the |
| 55 | +> proper action function. |
| 56 | +> 3. Use action view functions to return ask or tell responses. |
| 57 | +
|
| 58 | +Documentation |
| 59 | +------------- |
| 60 | + |
| 61 | +- Check out the [Quick |
| 62 | + Start](http://flask-assistant.readthedocs.io/en/latest/quick_start.html) |
| 63 | + to jump right in |
| 64 | +- View the full |
| 65 | + [documentation](http://flask-assistant.readthedocs.io/en/latest/) |
0 commit comments