Skip to main content

Tencent TRTC edge transport for Vision Agents

Project description

Vision Agents Plugin: Tencent TRTC Edge

Tencent TRTC (Real-Time Communication) edge transport for Vision Agents. Lets an agent join a Tencent TRTC room and exchange audio/video with participants using the Tencent LiteAV SDK Python bindings.

Quickstart

Talk to an agent in 5 minutes. You'll need Docker, an .env with TENCENT_SDK_APP_ID, TENCENT_SDK_SECRET_KEY, OPENAI_API_KEY, and ELEVEN_API_KEY at the repo root, and a working microphone in a Chromium-based browser. The example pairs Tencent TRTC with OpenAI (LLM) and ElevenLabs (STT + TTS) — chosen because Gemini and Cartesia aren't reachable from mainland China, which is the natural deployment target for this edge.

  1. Open Tencent's hosted TRTC Web SDK quick demo: https://web.sdk.qcloud.com/trtc/webrtc/v5/demo/quick-demo-js/index.html

    • Paste your TENCENT_SDK_APP_ID into SDKAppID and TENCENT_SDK_SECRET_KEY into SDKSecretKey — the page generates UserSig client-side.
    • Leave the auto-generated UserID and RoomID(String) as is.
    • Click Enter Room → demo log should print 🟩 [user_***] enterRoom.
    • Click Start Local Video — this also publishes the mic.
  2. Copy the RoomID(String) from the demo form and launch the agent with it:

    cd plugins/tencent
    TENCENT_TEST_ROOM_ID=<paste-room-id-here> docker compose run --rm tencent-agent
    

    On first run this builds the image and resolves the workspace; subsequent runs are fast. When the agent joins you'll see Tencent TRTC OnRemoteUserEnterRoom: <userId> matching the UserID shown in the demo.

  3. Talk. The flow is browser → Tencent → STT (ElevenLabs) → LLM (OpenAI) → TTS (ElevenLabs) → Tencent → browser. Confirm each leg in the agent log:

    • 🎤 [Transcript Complete]: … — STT got your speech.
    • 🤖 [LLM response final]: … — LLM produced a reply.
    • Reply plays back in the browser.

Usage in your own code

from vision_agents.core import Agent, User
from vision_agents.plugins import tencent

agent_user = User(id="agent-1", name="Agent")
edge = tencent.Edge(
    sdk_app_id=YOUR_SDK_APP_ID,
    user_sig=USER_SIG,  # or key=KEY to generate per join
)

agent = Agent(
    edge=edge,
    agent_user=agent_user,
    llm=...,
    # stt, tts, etc.
)

call = await edge.create_call(call_id=str(ROOM_ID), room_id=ROOM_ID)
await agent.join(call)
await agent.finish()

Install

uv add vision-agents-plugins-tencent

On Linux this pulls liteav from PyPI. On macOS the liteav dependency is skipped via a platform marker, so the package installs but tencent.Edge() raises at runtime — use the Docker setup from the Quickstart.

Configuration

tencent.Edge(...) parameters:

  • sdk_app_id (int): Tencent TRTC SDK App ID. Falls back to TENCENT_SDK_APP_ID env var.
  • user_sig (str): User signature for the agent user.
  • key (str): Optional. If set and user_sig is not, the plugin generates user_sig via TLSSigAPIv2. Falls back to TENCENT_SDK_SECRET_KEY env var.
  • video_fps (int): Outgoing video frame rate.

Environment variables:

  • TENCENT_SDK_APP_ID, TENCENT_SDK_SECRET_KEY — credentials.
  • TENCENT_TRTC_SCENE — one of auto (default), videocall, call, record.
  • TENCENT_TEST_ROOM_ID — interpolated by docker-compose.yml into the example runner's --call-id flag.

Platform support

The underlying liteav package ships only manylinux wheels — Linux x86_64 / aarch64 only. macOS and Windows must run the agent inside a Linux container (see Quickstart). User sigs are needed for room entry; either generate them with TLSSigAPIv2 or pass key= and let the plugin sign per join.

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

vision_agents_plugins_tencent-0.6.4.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

vision_agents_plugins_tencent-0.6.4-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file vision_agents_plugins_tencent-0.6.4.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_tencent-0.6.4.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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}

File hashes

Hashes for vision_agents_plugins_tencent-0.6.4.tar.gz
Algorithm Hash digest
SHA256 00d5ee9fc4e0e3ae463535870dd051c2c3fc6c787dab9ee2e261ec66ad4b0be9
MD5 e05f1d8075086a36df1455507c0fa60e
BLAKE2b-256 e04e567ef355323c537d60c947439b21179d7e901fad231f4b8ca226490dc147

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_tencent-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: vision_agents_plugins_tencent-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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}

File hashes

Hashes for vision_agents_plugins_tencent-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 488f4eabd0bc4affddf045d6e410d5a4d901171e4306252463722f083131c671
MD5 b73263f29aa2bf1f97f8f60001e3d0b4
BLAKE2b-256 9b6ca4c366e3b58a8e0b6973cc97fbefbb63be3f2e0d4a7bdbbe0451d2b14558

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