A Python package for Voiceflow API.
Project description
Voiceflow Python Package
This is an unofficial Python package for an easy use of the Voiceflow API.
Basic usage
In your virtual environment:
pip install voiceflow
Then in your Python code:
import os
from voiceflow import Voiceflow
vf = Voiceflow(
api_key=os.getenv('VOICEFLOW_API_KEY'),
user_id='abc123'
)
# Launch the agent
vf_response = vf.interact.launch()
# Send a simple text input
vf_response = vf.interact.text(user_input='hello')
Pass the version of your Voiceflow project to contact. It can be development (default) or production.
vf = Voiceflow(
api_key=os.getenv('VOICEFLOW_API_KEY'),
user_id='abc123',
version_id='production'
)
You can also call launch() or text() with your custom config:
vf_response = vf.interact.launch(config={'stripSSML': False})
Default config values:
{
'tts': False,
'stripSSML': True,
'stopAll': True,
'stopTypes': [],
'excludeTypes': [
'block',
'debug',
'flow',
]
}
User State:
# Fetch the user's current state
vf_response = vf.user_state.fetch()
# NotImplemented:
# Update the user's current state.
# Delete all state and session data for user.
Variables:
variables = {
'test1': 'one',
'test2': 2,
}
vf_response = vf.variables.update(variables=variables)
About this project
This project is created and maintained by:
Daian Gan
Github: daiangan
E-mail: daian@ganmedia.com
Website: https://daiangan.com
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
voiceflow-1.0.5.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for voiceflow-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dad1298f61f383f1d4db5be36f690f21395a595acc03df27357986b5ea83791 |
|
MD5 | db57db2932c5b5b37f894f2e36b9c075 |
|
BLAKE2b-256 | 751d9a238f5e56a89674b9680851f2086f109a1bbda3933258042db16bc56956 |