Skip to main content

Synthesia plugin for LiveKit Agents

Attach a Synthesia interactive avatar to a LiveKit voice agent. The avatar joins the room and lip-syncs the agent's speech in real time.

See the Synthesia integration docs for more information.

Installation

pip install livekit-plugins-synthesia

Pre-requisites

You'll need an API key from Synthesia. It can be set as an environment variable: SYNTHESIA_API_KEY

Usage

from livekit.plugins import synthesia

avatar = synthesia.AvatarSession(
    synthesia.AvatarConfig(
        avatar_ids=["03cee7ec-ac90-45ec-8c20-74a399cf3dc4"]
    ),  # SYNTHESIA_API_KEY from env
)
await avatar.start(session, room=ctx.room)  # before session.start
await session.start(agent=Agent(...), room=ctx.room)

Set your Synthesia workspace API key in SYNTHESIA_API_KEY, or pass api_key=. avatar_ids takes one to five gallery ids of avatars available to your workspace. The first is the active avatar; the rest are precomputed by the worker so swap_avatar() can switch to them mid-session. An id your workspace cannot access raises synthesia.SynthesiaError with type=synthesia.ErrorType.UNKNOWN_AVATAR.

await avatar.swap_avatar("<another-id-from-avatar-ids>")  # switch mid-session
await avatar.swap_avatar("default")  # back to the first id

Parameters

Parameter Default Description
avatar_participant_identity "synthesia-avatar-agent" The LiveKit identity the avatar joins under. Must be unique per concurrent avatar in a room: LiveKit evicts an existing participant when a second joins with the same identity, so give each avatar its own identity to run several in one room.
avatar_participant_name "Synthesia avatar" The LiveKit display name the avatar joins under.
avatar = synthesia.AvatarSession(
    synthesia.AvatarConfig(avatar_ids=["03cee7ec-ac90-45ec-8c20-74a399cf3dc4"]),
    avatar_participant_identity="avatar-host",
)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit_plugins_synthesia-1.8.2.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

livekit_plugins_synthesia-1.8.2-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_synthesia-1.8.2.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_synthesia-1.8.2.tar.gz
Algorithm Hash digest
SHA256 5daa930b7d6d17dfe68d8a4c13af6080357aee401abc040517161981e219b047
MD5 e08748883d210282f414265258c7b56d
BLAKE2b-256 a43f71a279c1aa620128f3e32869e388ee554789322023574dc31bb4fd2e8bf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_synthesia-1.8.2.tar.gz:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file livekit_plugins_synthesia-1.8.2-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_synthesia-1.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e34c7ba00c5651bee9dfe3e8762c3e5f9074409846e8086a5e4420ca34f82e7e
MD5 6971f80a72e9d2a4c81376a8bca40395
BLAKE2b-256 22662e60a4596f4f9c8fb6e750561d9f4c4780ac73a89107696dd8b2e6f45200

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_synthesia-1.8.2-py3-none-any.whl:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.8.2 This release

2 files

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