Skip to main content

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, ToolDefinition

lookup_tool: ToolDefinition = {
    "name": "lookup_order",
    "description": "Look up an order by ID.",
    "parameters": {"type": "object", "properties": {"order_id": {"type": "string"}}},
    "read_only": True,
    "wait_for_tool": True,
    "status_label": "order lookup",
}

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?",
        tools=[lookup_tool],
    ),
)

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.

WebRTC transport (experimental)

Experimental: the API is stable, but this transport is newly shipped and still being hardened on real networks; ws remains the default and recommended fallback.

Pass transport="webrtc" to ConverseSession.connect(...) to carry the session over WebRTC (UDP) instead of the default WebSocket. Requires pip install "converse-sdk[webrtc]" (or uv add). ws remains the default; most headless callers are fine on it. See the Python guide's WebRTC section.

Proprietary software. All rights reserved.

Metadata

Release files for converse-sdk 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for converse-sdk 0.2.1
File Size Uploaded Provenance
converse_sdk-0.2.1.tar.gz 15.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for converse-sdk 0.2.1
File Interpreter ABI Platform
converse_sdk-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / converse_sdk-0.2.1.tar.gz

Download URL converse_sdk-0.2.1.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
794d4da5e3e52ef7ad4c12c19b4b9b0898f9ce48041045b7e3453cb14a3512c2
BLAKE2b-256 checksum
How to use checksums
1a19023aefed772a30b805f11017092f57de363097d02143d011a5c6563a00b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / converse_sdk-0.2.1-py3-none-any.whl

Download URL converse_sdk-0.2.1-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05c24562cc2fce044b59d808ef0d667572b1f2ee99c5806d5acce908e6878ab5
BLAKE2b-256 checksum
How to use checksums
da2f1ed1c62fe24f43dd1395fcefb2e8bfbe736658e67f29b3400f82614e05f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for converse-sdk 0.2.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page