# 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!
Raw data
{
"_id": null,
"home_page": "https://github.com/gcaccaos/dialogflow-fulfillment",
"name": "dialogflow-fulfillment",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "",
"keywords": "dialogflow,fulfillment,webhook,api,python",
"author": "Gabriel Farias Cacc\u00e1os",
"author_email": "gabriel.caccaos@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/96/8a/d5223c9d9703b6a69f7c56b9bb65b0f617bda4f99e92c53c948896eff2d2/dialogflow-fulfillment-0.4.5.tar.gz",
"platform": null,
"description": "# dialogflow-fulfillment\n\n![PyPI version](https://img.shields.io/pypi/v/dialogflow-fulfillment)\n[![Tests status](https://github.com/gcaccaos/dialogflow-fulfillment/workflows/Tests/badge.svg?&branch=master)](https://github.com/gcaccaos/dialogflow-fulfillment/actions)\n[![Documentation status](https://readthedocs.org/projects/dialogflow-fulfillment/badge/?version=latest)](https://dialogflow-fulfillment.readthedocs.io/en/latest/?badge=latest)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c666df0add06a523e65b/maintainability)](https://codeclimate.com/github/gcaccaos/dialogflow-fulfillment/maintainability)\n[![GitHub license](https://img.shields.io/github/license/gcaccaos/dialogflow-fulfillment)](https://github.com/gcaccaos/dialogflow-fulfillment/blob/master/LICENSE)\n\n*dialogflow-fulfillment* is a package for Python that helps developers to\ncreate webhook services for Dialogflow.\n\nThe package provides an API for creating and manipulating response messages,\noutput contexts and follow-up events in conversations.\n\n## A simple example\n\n```python\nfrom dialogflow_fulfillment import QuickReplies, WebhookClient\n\n\n# Define a custom handler function\ndef handler(agent: WebhookClient) -> None:\n \"\"\"\n This handler sends a text message along with a quick replies message\n back to Dialogflow, which uses the messages to build the final response\n to the user.\n \"\"\"\n agent.add('How are you feeling today?')\n agent.add(QuickReplies(quick_replies=['Happy :)', 'Sad :(']))\n\n\n# Create an instance of the WebhookClient\nagent = WebhookClient(request)\n\n# Handle the request using the handler function\nagent.handle_request(handler)\n\n# Get the response\nresponse = agent.response\n```\n\n## Installation\n\nThe preferred way to install *dialogflow-fulfillment* is from\n[PyPI](https://pypi.org/project/dialogflow-fulfillment/) with\n[**pip**](https://pip.pypa.io/):\n\n```shell\npip install dialogflow-fulfillment\n```\n\n## Features\n\n*dialogflow-fulfillment*'s key features are:\n\n* **Webhook Client**: handle webhook requests using a custom handler function\n or a map of handlers for each intent\n* **Contexts**: process input contexts and add, set or delete output contexts\n* **Events**: trigger follow-up events with optional parameters\n* **Rich Responses**: create and send the following types of rich response\n messages:\n * Text\n * Image\n * Card\n * Quick Replies\n * Payload\n\n## More examples\n\n* [Dialogflow fulfillment webhook server with **Flask**](https://dialogflow-fulfillment.readthedocs.io/en/latest/getting-started/examples/flask/)\n* [Dialogflow fulfillment webhook server with **Django**](https://dialogflow-fulfillment.readthedocs.io/en/latest/getting-started/examples/django/)\n\n## Documentation\n\nFor more information about the package, guides and examples of usage, see the\n[documentation](https://dialogflow-fulfillment.readthedocs.io).\n\n## Contribute\n\nAll kinds of contributions are welcome!\n\nFor an overview about how to contribute to *dialogflow-fulfillment*, see the\n[contributing guide](CONTRIBUTING.rst).\n\n## License\n\nThis project is licensed under the Apache 2.0 license.\n\nFor more details about the license, see the [LICENSE file](LICENSE).\n\n## Acknowledgments\n\nThanks to the Dialogflow development team!\n\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Create webhook services for Dialogflow using Python",
"version": "0.4.5",
"split_keywords": [
"dialogflow",
"fulfillment",
"webhook",
"api",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "968ad5223c9d9703b6a69f7c56b9bb65b0f617bda4f99e92c53c948896eff2d2",
"md5": "8ca75472b2966ea23808d3e5f76b5db4",
"sha256": "a9a74f8516548ccc4c8c5db27f94918e1de24a34a140f5ef2fa02bb548d5219c"
},
"downloads": -1,
"filename": "dialogflow-fulfillment-0.4.5.tar.gz",
"has_sig": false,
"md5_digest": "8ca75472b2966ea23808d3e5f76b5db4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 17629,
"upload_time": "2023-01-19T11:30:17",
"upload_time_iso_8601": "2023-01-19T11:30:17.503460Z",
"url": "https://files.pythonhosted.org/packages/96/8a/d5223c9d9703b6a69f7c56b9bb65b0f617bda4f99e92c53c948896eff2d2/dialogflow-fulfillment-0.4.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-19 11:30:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "gcaccaos",
"github_project": "dialogflow-fulfillment",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "dialogflow-fulfillment"
}