Metadata-Version: 2.1
Name: dialogflow-fulfillment
Version: 0.4.4
Summary: Create webhook services for Dialogflow using Python
Home-page: https://github.com/gcaccaos/dialogflow-fulfillment
Author: Gabriel Farias Caccáos
Author-email: gabriel.caccaos@gmail.com
License: Apache License 2.0
Project-URL: Documentation, https://dialogflow-fulfillment.readthedocs.io
Keywords: dialogflow,fulfillment,webhook,api,python
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: tox (==3.24.1) ; extra == 'dev'
Requires-Dist: setuptools (==57.4.0) ; extra == 'dev'
Requires-Dist: wheel (==0.36.2) ; extra == 'dev'
Requires-Dist: twine (==3.4.2) ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx (==4.1.2) ; extra == 'docs'
Requires-Dist: sphinx-autobuild (==2021.3.14) ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme (==0.5.2) ; extra == 'docs'
Requires-Dist: sphinxcontrib-mermaid (==0.7.1) ; extra == 'docs'
Provides-Extra: lint
Requires-Dist: flake8 (==3.9.2) ; extra == 'lint'
Requires-Dist: flake8-docstrings (==1.6.0) ; extra == 'lint'
Requires-Dist: flake8-isort (==4.0.0) ; extra == 'lint'
Requires-Dist: pre-commit (==2.13.0) ; extra == 'lint'
Provides-Extra: tests
Requires-Dist: pytest (==6.2.4) ; extra == 'tests'
Requires-Dist: coverage (==5.5) ; extra == 'tests'

# dialogflow-fulfillment

![PyPI version](https://img.shields.io/pypi/v/dialogflow-fulfillment)
[![Tests status](https://github.com/gcaccaos/dialogflow-fulfillment/workflows/Tests/badge.svg?&branch=master)](https://github.com/gcaccaos/dialogflow-fulfillment/actions)
[![Documentation status](https://readthedocs.org/projects/dialogflow-fulfillment/badge/?version=latest)](https://dialogflow-fulfillment.readthedocs.io/en/latest/?badge=latest)
[![Maintainability](https://api.codeclimate.com/v1/badges/c666df0add06a523e65b/maintainability)](https://codeclimate.com/github/gcaccaos/dialogflow-fulfillment/maintainability)
[![GitHub license](https://img.shields.io/github/license/gcaccaos/dialogflow-fulfillment)](https://github.com/gcaccaos/dialogflow-fulfillment/blob/master/LICENSE)

*dialogflow-fulfillment* is a package for Python that helps developers to
create webhook services for Dialogflow.

The package provides an API for creating and manipulating response messages,
output contexts and follow-up events in conversations.

## A simple example

```python
from dialogflow_fulfillment import QuickReplies, WebhookClient


# Define a custom handler function
def handler(agent: WebhookClient) -> None:
    """
    This handler sends a text message along with a quick replies message
    back to Dialogflow, which uses the messages to build the final response
    to the user.
    """
    agent.add('How are you feeling today?')
    agent.add(QuickReplies(quick_replies=['Happy :)', 'Sad :(']))


# Create an instance of the WebhookClient
agent = WebhookClient(request)

# Handle the request using the handler function
agent.handle_request(handler)

# Get the response
response = agent.response
```

## Installation

The preferred way to install *dialogflow-fulfillment* is from
[PyPI](https://pypi.org/project/dialogflow-fulfillment/) with
[**pip**](https://pip.pypa.io/):

```shell
pip install dialogflow-fulfillment
```

## Features

*dialogflow-fulfillment*'s key features are:

* **Webhook Client**: handle webhook requests using a custom handler function
  or a map of handlers for each intent
* **Contexts**: process input contexts and add, set or delete output contexts
* **Events**: trigger follow-up events with optional parameters
* **Rich Responses**: create and send the following types of rich response
  messages:
  * Text
  * Image
  * Card
  * Quick Replies
  * Payload

## More examples

* [Dialogflow fulfillment webhook server with **Flask**](https://dialogflow-fulfillment.readthedocs.io/en/latest/getting-started/examples/flask/)
* [Dialogflow fulfillment webhook server with **Django**](https://dialogflow-fulfillment.readthedocs.io/en/latest/getting-started/examples/django/)

## Documentation

For more information about the package, guides and examples of usage, see the
[documentation](https://dialogflow-fulfillment.readthedocs.io).

## Contribute

All kinds of contributions are welcome!

For an overview about how to contribute to *dialogflow-fulfillment*, see the
[contributing guide](CONTRIBUTING.rst).

## License

This project is licensed under the Apache 2.0 license.

For more details about the license, see the [LICENSE file](LICENSE).

## Acknowledgments

Thanks to the Dialogflow development team!


