Welcome to the Uh!ive Python SDK
The Uh!ive Python SDK is a library to access our live Automated Speech Recognition online APIs. It provides I/O Free Python abstractions over the underlying protocols and workflows to hide the complexity.
By providing an I/O Free implementation, we let developers choose whatever websocket transport library and paradigm — synchronous or asynchronous (asyncio) — they like most.
Access to the API
In order to have access to our online APIs, your company needs to register for an account. Depending on the plan, you may get two kinds of credentials:
- Either a
client_idandclient_secret; - or a
client_id,user_idanduser_password.
In all cases, those credentials are used to retrieve a one time access token from our SSO.
You are free to use whatever HTTP client library you like.
Here is a synchronous example using requests:
from uhlive.auth import build_authentication_request
import requests
uhlive_client = "…"
uhlive_secret = "…"
# user_id = "…"
# user_password = "…"
auth_url, auth_params = build_authentication_request(uhlive_client, uhlive_secret)
# or auth_url, auth_params = build_authentication_request(uhlive_client, user_id=user_id, user_pwd=user_password)
login = requests.post(auth_url, data=auth_params)
login.raise_for_status()
uhlive_token = login.json()["access_token"]
Here is an asynchronous example using aiohttp:
import asyncio
from uhlive.auth import build_authentication_request
from aiohttp import ClientSession
uhlive_client = "…"
uhlive_secret = "…"
# user_id = "…"
# user_password = "…"
async def main(uhlive_client, uhlive_secret):
async with ClientSession() as session:
auth_url, auth_params = build_authentication_request(
uhlive_client, uhlive_secret
)
async with session.post(auth_url, data=auth_params) as login:
login.raise_for_status()
body = await login.json()
uhlive_token = body["access_token"]
# continue with Stream API of your choice
# ...
asyncio.run(main(uhlive_client, uhlive_secret))
Then this one time token allows you to connect to any subscribed API within 5 minutes.
Conversation API to analyze human to human interactions.
Also known as the human to human (H2H) stream API.
Recognition and interpretation API for voice bots.
Also known as the human to bot (H2B) stream API.
Changelog
v2.0.0
- Support for the H2H (conversation) protocol version 2 based on universal annotations.
- Legacy H2H protocol v1 is not supported anymore.
- Drop support for Python 3.9 and below
v1.6.1
- Support for phones.
- Last release to support the H2H protocol version 1.
v1.5.1
- API fix:
RecogResult.alternativesnow returns an empty list instead ofNone.
v1.5.0
- Support for the
n_best_list_lengthparameter to get alternatives transcriptions and interpretations when available. - Dropped support for Python versions < 3.9
v1.4.0
- Support for the
session_idparameter to theopencommand.
v1.3.1
Full API documentation.
v1.3.0
- Support for
SegmentNormalized - SSO
- Concurrent test runner
test_runner_async.pyinexamples/recognition
v1.2.0
- Improved streamer
- Improved test_runner.py
- Forbid sharing connection between conversations
v1.1.0
- Support for passing codec parameter