LiveAvatar
Updated
Use a LiveAvatar avatar to represent your agent on video in a Conversational AI Platform agent.
Preview documentation
LiveAvatar by HeyGen provides AI-powered avatars with high-quality video rendering and customizable video quality settings, enabling professional video conversations with your AI agents.
Sample configuration
The following example shows how to configure LiveAvatar as the agent's avatar when you create or update an agent. For a complete example, see Create an agent and start a session.
LiveAvatar supports BYOK only. It isn't available in managed mode. Store your LiveAvatar API key in a secret set, and refer to it from the agent. For details, see Use your own provider keys.
from agora_agent import Agent, LiveAvatarAvatar, secret_ref
# client is your configured Agora client
agent = (
Agent(client=client)
.with_stt(...) # configure your ASR vendor
.with_llm(...) # configure your LLM vendor
.with_tts(...) # configure a TTS vendor with a 24,000 Hz sample rate
.with_avatar(
LiveAvatarAvatar(
api_key=secret_ref("support_prod", "liveavatar"),
quality="high",
agora_uid="<avatar_rtc_uid>",
agora_token="<avatar_rtc_token>",
avatar_id="65f9e3c9-d48b-4118-b73a-4ae2e3cbb8f0",
)
)
)import { Agent, LiveAvatarAvatar, secretRef } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your ASR vendor */)
.withLlm(/* configure your LLM vendor */)
.withTts(/* configure a TTS vendor with a 24,000 Hz sample rate */)
.withAvatar(
new LiveAvatarAvatar({
apiKey: secretRef('support_prod', 'liveavatar'),
quality: 'high',
agoraUid: '<avatar_rtc_uid>',
agoraToken: '<avatar_rtc_token>',
avatarId: '65f9e3c9-d48b-4118-b73a-4ae2e3cbb8f0',
}),
);// client is your configured Agora client
agent := agentkit.NewAgent(client).
WithStt( /* configure your ASR vendor */ ).
WithLlm( /* configure your LLM vendor */ ).
WithTts( /* configure a TTS vendor with a 24,000 Hz sample rate */ ).
WithAvatar(vendors.NewLiveAvatarAvatar(vendors.LiveAvatarAvatarOptions{
APIKey: agentkit.SecretRef("support_prod", "liveavatar"),
Quality: "high",
AgoraUID: "<avatar_rtc_uid>",
AgoraToken: "<avatar_rtc_token>",
AvatarID: "65f9e3c9-d48b-4118-b73a-4ae2e3cbb8f0",
}))Add an avatar block to the pipeline. Set credential.mode to byok and credential.fields.api_key to the reference. In the following example, the key is stored as liveavatar in the support_prod set:
"avatar": {
"enabled": true,
"credential": {
"mode": "byok",
"fields": {
"api_key": "$secrets.support_prod.liveavatar"
}
},
"vendor": "liveavatar",
"params": {
"agora_token": "<avatar_rtc_token>",
"agora_uid": "<avatar_rtc_uid>",
"quality": "high",
"avatar_id": "65f9e3c9-d48b-4118-b73a-4ae2e3cbb8f0"
}
}Info
LiveAvatar only supports audio with a sample rate of 24,000 Hz. Using a TTS model configured with a different sample rate results in an error. Make sure that your TTS configuration matches this requirement.
Key parameters
The avatar block takes the following fields. In the SDKs, LiveAvatarAvatar sets them from its options, and passes any other parameters from its additional parameters option to params.
| Parameter | Description |
|---|---|
enabledboolean | Set to |
vendorstring | Set to |
credentialobject | Set |
paramsobject |
|
For advanced configuration options, refer to the LiveAvatar official documentation.
This integration is fully supported for use with the Conversational AI Platform. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
