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.2.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.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vox_rtc_server-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 dce38791bd4e809c4717e75dc55c88c56d3c19702bf6ef1020296e306cd3269a
MD5 10547a8454748855c221d5cb28cb32f4
BLAKE2b-256 65bc31501558bf9b6ff18f32320bc7fb2d426d53901776162d1e8ff0919e087b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vox_rtc_server-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d89621ae828e2a4a580459b83427a616acda4647205a673c032023e1c1055d8
MD5 c3f5c9ef44be52278fa902f2789f5503
BLAKE2b-256 6862b997078e65af8bb86e6bcaa95dbd5c61b274a77304604e9c4de97afb8bf7

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