Dialog Flow DB Connector
There is an addon for the Dialog Flow Framework, a minimalistic open-source engine for conversational services.
Dialog Flow DB Connector allows you to to save and retrieve user dialogue states (in the form of a Context object) using various database backends.
Currently, the supported options are:
Aside from this, we offer some interfaces for saving data to your local file system. These are not meant to be used in production, but can be helpful for prototyping your application.
Quick Start
Installation
pip install df-db-connector
Please, note that if you are going to use one of the database backends, you will have to specify an extra or install the corresponding requirements yourself.
pip install df-db-connector[redis]
pip install df-db-connector[mongodb]
pip install df-db-connector[mysql]
pip install df-db-connector[postgresql]
pip install df-db-connector[sqlite]
pip install df-db-connector[ydb]
Basic example
from df_engine.core import Context, Actor
from df_db_connector import SQLConnector
from .script import some_df_script
db = SQLConnector("postgresql://user:password@host:port/dbname")
actor = Actor(some_df_script, start_label=("root", "start"), fallback_label=("root", "fallback"))
def handle_request(request):
user_id = request.args["user_id"]
if user_id not in db:
context = Context(id=user_id)
else:
context = db[user_id]
new_context = actor(context)
db[user_id] = new_context
assert user_id in db
return new_context.last_response
To get more advanced examples, take a look at examples on GitHub.
Contributing to the Dialog Flow DB Connector
Please refer to CONTRIBUTING.md.
Metadata
Release files for df-db-connector 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| df_db_connector-0.3.1.tar.gz | 22.5 kB | Without provenance | Details for df_db_connector-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| df_db_connector-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for df_db_connector-0.3.1-py3-none-any.whl |
Total release size: 47.8 kB
Release files / df_db_connector-0.3.1.tar.gz
| Download URL | df_db_connector-0.3.1.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d270ebe2a0bef05c15d20ed3d5d81806f0154bb9cf7e8d15897471fb0b3b298
|
|
BLAKE2b-256 checksum How to use checksums |
4b3aa432af127247f2c31a2bea016b1e33677769150bd7722f254a4167c0cabf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / df_db_connector-0.3.1-py3-none-any.whl
| Download URL | df_db_connector-0.3.1-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a1132a87d53fca605e1cde2ab738c3fe24b0f2fad424a8b38d8ff01f6200033
|
|
BLAKE2b-256 checksum How to use checksums |
4861f2614a950e76d5c851814b5bc6ad8fb6409ba0a02645830f5bd3e17d1abf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for df-db-connector 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.