Skip to main content

Documentation Index

Fetch the complete documentation index at: https://visionagents.ai/llms.txt

Use this file to discover all available pages before exploring further.

Tencent RTC (Real-Time Communication) is an edge transport plugin that replaces the default communication layer in Vision Agents. It connects your agent to Tencent’s global real-time network, optimized for ultra-low latency in mainland China and across Asia.

Why Tencent RTC

  • Low-latency in Asia - Tencent’s edge network delivers strong performance in Asia, where other transport providers may face higher latency or connectivity issues.
  • Frontend SDKs - Tencent provides client SDKs for Web, iOS, and Android, so you can build end-user applications that connect to the same RTC room as your agent.
  • Drop-in replacement - The plugin implements the same EdgeTransport interface. Swap edge=tencent.Edge(...) into your Agent and keep your existing LLM, STT, TTS, vision, and avatar plugins unchanged.
  • Audio and video — Supports both audio and video tracks for voice agents, video agents, and multimodal applications.

Installation

uv add vision-agents["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 in Get Started below.

Get Started

Talk to an agent in about five minutes. You need Docker, an .env at the Vision Agents repo root with TENCENT_SDK_APP_ID, TENCENT_SDK_SECRET_KEY, OPENAI_API_KEY, and ELEVEN_API_KEY, and a working microphone in a Chromium-based browser. The example pairs Tencent TRTC with OpenAI (LLM) and ElevenLabs (STT + TTS).

Set up credentials and join from the browser

Create an RTC application in the Tencent RTC Console to obtain your credentials:
VariableDescription
TENCENT_SDK_APP_IDYour RTC application’s integer App ID
TENCENT_SDK_SECRET_KEYSecret key for generating user signatures
Open Tencent’s hosted TRTC Web SDK quick demo:
  • 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 — the demo log should print 🟩 [user_***] enterRoom.
  • Click Start Local Video — this also publishes the mic.

Launch the agent in Docker

Clone the Vision Agents repo, copy the RoomID(String) from the demo form, and start the example agent:
git clone https://github.com/GetStream/Vision-Agents.git
cd Vision-Agents/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 faster. When the agent joins you’ll see Tencent TRTC OnRemoteUserEnterRoom: <userId> matching the UserID shown in the demo.

Talk to the agent

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

All Vision Agents features work out of the box with the Tencent transport. Swap in any LLM, STT, TTS, vision, or avatar plugin, use function calling, tools, and knowledge, everything works the same way as with the default transport.
import os

from vision_agents.core import Agent, Runner, User
from vision_agents.core.agents import AgentLauncher
from vision_agents.plugins import elevenlabs, openai, tencent


async def create_agent(**kwargs) -> Agent:
    agent = Agent(
        edge=tencent.Edge(
            sdk_app_id=int(os.environ["TENCENT_SDK_APP_ID"]),
            key=os.environ["TENCENT_SDK_SECRET_KEY"],
        ),
        agent_user=User(name="Tencent Voice Agent", id="tencent-voice-agent"),
        instructions="You are a helpful voice assistant. Respond concisely.",
        llm=openai.LLM(),
        tts=elevenlabs.TTS(),
        stt=elevenlabs.STT(),
    )
    return agent


async def join_call(agent: Agent, call_type: str, call_id: str, **kwargs) -> None:
    await agent.authenticate()
    # `call_id` must match the RoomID(String) from the Tencent demo so the
    # browser participant is already in the room before the agent connects.
    call = await agent.create_call(call_type, call_id)

    async with agent.join(call, participant_wait_timeout=None):
        await agent.say("Hi! How can I help you today?")
        await agent.finish()


if __name__ == "__main__":
    Runner(AgentLauncher(create_agent=create_agent, join_call=join_call)).cli()
The underlying liteav package ships only manylinux wheels — Linux x86_64 / aarch64 only. On macOS and Windows, run the agent inside a Linux container (see Get Started). User signatures are required for room entry; either generate them with TLSSigAPIv2 or pass key= and let the plugin sign per join.

Parameters

NameTypeDefaultDescription
sdk_app_idintNoneRTC application ID. Falls back to the TENCENT_SDK_APP_ID environment variable if not provided.
keystrNoneSecret key for generating user signatures. Falls back to TENCENT_SDK_SECRET_KEY if not provided.
user_sigstrNonePre-computed user signature. If omitted, a signature is generated automatically from key at join time. See the UserSig generation guide.
video_fpsint15Frames per second for outgoing video encoding (supported range: 560).

Environment Variables

VariableDefaultDescription
TENCENT_SDK_APP_IDFallback for sdk_app_id when not passed to the constructor.
TENCENT_SDK_SECRET_KEYFallback for key when not passed to the constructor.
TENCENT_TRTC_SCENEautoRoom scene type. One of auto, videocall, call, or record. auto selects the first available from videocall and call.
TENCENT_TEST_ROOM_IDUsed by the plugin’s docker-compose.yml as the example runner’s --call-id flag.

Frontend SDKs

Tencent provides client SDKs for joining the same RTC room from end-user applications. Your users connect with a Tencent frontend SDK while your Vision Agent runs server-side with this plugin — both in the same room. See the Tencent RTC documentation for Web, iOS, and Android client SDK guides.

Next Steps

Deploying Agents

Run your agent locally, containerize it, and scale to production.

Create Your Own Plugin

Build a custom plugin to connect additional services.