Skip to main content

Framework for Building Virtual Assistants with API.AI

Project description

https://img.shields.io/pypi/v/flask-assistant.svg https://travis-ci.org/treethought/flask-assistant.svg?branch=master https://img.shields.io/badge/python-2.7,3.5,3.6-blue.svg Join the chat at https://gitter.im/flask-assistant/Lobby

A flask extension serving as an API.AI SDK to provide an easy way to create virtual assistants which may be integrated with platforms such as Actions on Google (Google Assistant).

Flask-Assistant allows you to focus on building the core business logic of conversational user interfaces while utilizing API.AI’s Natural Language Processing to interact with users.

Recent Updates:

This project is heavily inspired and based on John Wheeler’s Flask-ask for the Alexa Skills Kit.

Features

  • Mapping of user-triggered Intents to action functions

  • Context support for crafting dialogue dependent on the user’s requests

  • Define prompts for missing parameters when they are not present in the users request or past active contexts

  • A convenient syntax resembling Flask’s decoratored routing

  • Internal API.AI schema generation and registration

Hello World

from flask import Flask
from flask_assistant import Assistant, ask

app = Flask(__name__)
assist = Assistant(app)

@assist.action('Demo')
def hello_world():
    speech = 'Microphone check 1, 2 what is this?'
    return ask(speech)

if __name__ == '__main__':
    app.run(debug=True)

How-To

  1. Create an Assistant object with a Flask app and the route to your webhook URL.

  2. Use action decorators to map the intents to the proper action function.

  3. Use action view functions to return ask or tell responses.

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-Assistant-0.2.93.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

Flask_Assistant-0.2.93-py2.py3-none-any.whl (20.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page