Headless Python SDK for the Trelis Converse realtime voice API.
Project description
converse-sdk
The headless Python SDK for the Trelis Converse realtime voice API. Use it for telephony bridges, services, evaluations and custom devices.
uv add converse-sdk
The session-loop fragment below assumes your media layer supplies mic_frame and play_audio,
and your application supplies run_tool:
import os
from converse_sdk import ConverseMode, ConverseSession
session = await ConverseSession.connect(
"wss://converse.trelis.com/ws",
api_key=os.environ["CONVERSE_API_KEY"],
mode=ConverseMode(
instructions="Help callers with their orders.",
greeting="Hello, how can I help?",
),
)
async with session:
await session.send_audio(mic_frame) # PCM16 little-endian mono at 16 kHz
async for event in session.events():
if event.type == "audio":
play_audio(event.audio) # Float32 mono at 16 kHz
elif event.type == "tool_call":
result = await run_tool(event.data["name"], event.data["args"])
await session.send_tool_result(event.data["id"], result)
The SDK deliberately does not own capture, playback, pacing or echo cancellation. Live playback integrations must implement the playback contract.
See the complete Python reference and the Twilio bridge quickstart.
Proprietary software. All rights reserved.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file converse_sdk-0.1.0.tar.gz.
File metadata
- Download URL: converse_sdk-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9477929d567ce2960cd7c24e6dfd22da1abff6b389b1bd0c99ad8af12c74c024
|
|
| MD5 |
23da0164ebe7c151a3d9cc6dfc433669
|
|
| BLAKE2b-256 |
c99a007a1084700480673717543847e29e3d3e9811d9ce768aa939017bc924ff
|
File details
Details for the file converse_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: converse_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0d017a23a2d43d0f11f91b671212e2d9e28c89a7e811d8de8618e37968482df
|
|
| MD5 |
becdbbcc9ce8e139f6feff0fa46b5578
|
|
| BLAKE2b-256 |
763b516177c782253f36f0b3205042e1b4629c99fe7f0a4207c2f3ed461a7c9a
|