Voysis Query API Python Library
Project description
Voysis Python Library
The Voysis Python Library provides a set of classes that allow Python applications to interact with Voysis Query API endpoints.
A command-line invocation tool is also supplied to provide both an easy way to interact with the Voysis Query API and a working example of how to consume the library classes.
Installation
To install from the PyPI repository, simply run
pip3 install --upgrade voysis-python
or to install from this source tree, execute
python3 setup.py install
Requirements
The Voysis Python library and command line tool require Python 3, with Python 3.6 being the recommended environment.
portaudio is required to operate in a Mac OSX environment. This can
be installed using Homebrew
brew install portaudio
API Documentation
The full documentation for the Voysis API can be found here: Voysis Developer Documentation
VTC: The Voysis Test Client
This project supplies a command-line testing tool called voysis-vtc, which
provides a simple way to test and interact with a Voysis Voice AI.
Getting Help
After installation, run voysis-vtc --help for a summary of the command line
arguments and sub-commands available. Re-running the tool with a sub-command
name and --help will give further help for that sub-command:
voysis-vtc query --help
Specifying Your Voice AI Endpoint
To execute queries against your Voice AI endpoint, you will need to tell VTC the URL of your Voice AI. This URL will be supplied to you by Voysis.
To provide it to VTC, use the global --url option:
voysis-vtc --url wss://test.voysis.io/websocketapi query
You can also specify the endpoint URL in your environment so that you do not have to provide on the command line for each invocation:
export VTC_URL=wss://test.voysis.io/websocketapi
Authentication
Your Voice AI endpoint will require an authentication token to be
specified for queries to be successful. The VTC command supports
specifying a valid refresh token using the global --auth-token option:
voysis-vtc \
--auth-token=8U7CsQyiK8bqLwGnZUmnmgArbmiR9si50DIrjIHp5soAJ4i7NHB2Gg3IhlIgXYN1 \
--url=wss://test.voysis.io/websocketapi \
query
You can also provide the refresh token in your environment so that you do not need to provide it on the command line for each invocation:
export VTC_AUTH_TOKEN=8U7CsQyiK8bqLwGnZUmnmgArbmiR9si50DIrjIHp5soAJ4i7NHB2Gg3IhlIgXYN1
Interacting with Your Voice AI
The most direct way of interacting with your Voice AI is by sending a single query recorded from the microphone.
To record a voice query and send it to the Voice AI, execute
voysis-vtc query
and follow the on-screen prompts.
Sending an Audio File
The VTC client can send a file containing audio data rather than recording from the microphone. Currently only files containing raw samples or a wav file are supported. In both cases, the audio data must confirm to the following parameters:
- 16000Hz 16-bit signed integer single-channel PCM data.
voysis-vtc query --send audio_data.wav
Sending Many Audio Files
The VTC client supports sending a batch of audio files sequentially to a Voice AI endpoint. The path to a directory containing many wav files should be supplied on the command line:
voysis-vtc query --batch /path/to/wav/folder
Providing Query Feedback
The Voysis Query API supports providing feedback on the quality of the
results of an audio query. To provide this feedback, use the feedback
sub-command:
voysis-vtc feedback \
--query-id dda80ba2-f0fa-421d-8462-2f849bbb30b3 \
--rating 5 \
--description="Perfect results"
The rating is a simple integer in the range 1 - 5 with 1 representing the poorest quality and 5 representing the best. Description is a free-form string that can be used to provide additional information about why the query results were poor. This information will be stored alongside the query and can be used by Voysis to improve Voice AIs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file voysis-python-1.0.9a1.tar.gz.
File metadata
- Download URL: voysis-python-1.0.9a1.tar.gz
- Upload date:
- Size: 30.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad6e8d9252c4de0ce5131e86ab283368036745a25d534f8f635737803257d681
|
|
| MD5 |
3af51410bf4999592b6a2b718906d171
|
|
| BLAKE2b-256 |
25947a0e33ab354fced0883e39c7fdb57a7101d9908209680033dceb428d635e
|