Skip to main content

Server-side Python SDK for Vox-hosted WebRTC sessions.

Project description

vox-rtc-server

Server-side Python SDK for Vox-hosted WebRTC sessions.

This package is for backend applications that need to:

  • create RTC sessions over HTTP
  • attach to /v1/socket
  • join /rtc/{session_id}
  • send session.update, response.*, and client.event
  • observe RTC control events

It is intentionally narrow. It is not the general STT/TTS/text SDK.

Install

pip install vox-rtc-server pondsocket-client

The SDK uses the PondSocket Python client for the control-plane socket. Until pondsocket-client is published, install it from your local checkout or git ref. Authentication can be passed explicitly with api_key=... or through VOX_API_KEY.

Example

import asyncio
import os

from vox_rtc_server import (
    ClientEventEnvelope,
    SessionConfig,
    VoxRtcServerClient,
)


async def main() -> None:
    client = VoxRtcServerClient(
        http_base="https://vox.example.com",
        api_key=os.environ.get("VOX_API_KEY"),
    )

    bootstrap, session = await client.create_controlled_session()
    print("session:", bootstrap.session_id)

    session.on_event(lambda event: print(event.type, event.data))

    session.configure(
        SessionConfig(
            stt_model="parakeet-stt-onnx:tdt-0.6b-v3",
            tts_model="kokoro-tts-onnx:v1.0",
            voice="af_heart",
            turn_profile="browser_default",
            vad_backend="silero",
            turn_detector="livekit",
        )
    )

    session.send_text_response("Hello from Python.")
    session.send_client_event(
        ClientEventEnvelope(
            event="render.url",
            payload={"url": "https://example.com"},
        )
    )


asyncio.run(main())

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

vox_rtc_server-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vox_rtc_server-0.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file vox_rtc_server-0.1.1.tar.gz.

File metadata

  • Download URL: vox_rtc_server-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for vox_rtc_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5a091e946988ebb2c43a528995c7408fb2518cb3376a3773474b36196104dd3b
MD5 0403d05b919cb97c50932e804bde0dfe
BLAKE2b-256 78c2ded16e45a1f678103b024dc0ad0689f38cc903f6e71710d3ae52c1b9373f

See more details on using hashes here.

File details

Details for the file vox_rtc_server-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vox_rtc_server-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for vox_rtc_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25b2c1116e48c4e4d71176dd1260e3f7bfb685d6164288080277b149d9333618
MD5 25e559070483ec3912e3d6638710641b
BLAKE2b-256 c43261ec5c3ec96ce90e443c085a78d522b976d844df4b633875a9fe274d4536

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page