Anam
Updated
Integrate Anam AI avatars into Conversational AI Engine.
Anam provides AI-powered avatars with real-time video rendering, enabling natural video conversations with your AI agents.
Sample configuration
The following examples show how to configure an Anam avatar when starting a conversational AI agent.
from agora_agent import Agent
from agora_agent.agentkit.vendors import AnamAvatar
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(...) # configure your STT vendor
.with_llm(...) # configure your LLM vendor
.with_tts(...) # configure your TTS vendor
.with_avatar(AnamAvatar(
api_key='your-anam-key',
avatar_id='<anam_avatar_id>',
))
)import { Agent, AnamAvatar } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your STT vendor */)
.withLlm(/* configure your LLM vendor */)
.withTts(/* configure your TTS vendor */)
.withAvatar(new AnamAvatar({
apiKey: 'your-anam-key',
avatarId: '<anam_avatar_id>',
}));import (
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
WithLlm(/* configure your LLM vendor */).
WithTts(/* configure your TTS vendor */).
WithAvatar(
vendors.NewAnamAvatar(vendors.AnamAvatarOptions{
APIKey: "your-anam-key",
AvatarID: "<anam_avatar_id>",
}),
)Use the following avatar configuration in your request:
"avatar": {
"vendor": "anam",
"enable": true,
"params": {
"api_key": "<anam_key>",
"avatar_id": "960f614f-ea88-47c3-9883-f02094f70874",
"agora_uid": "<avatar_rtc_uid>",
"agora_token": "<avatar_rtc_token>",
"sample_rate": 24000,
"quality": "high",
"video_encoding": "H264"
}
}Key parameters
| Parameter | Description |
|---|---|
api_keystring | The API key used for authentication with Anam's services. Get your API key from the Anam console. |
avatar_idstring | The unique identifier for the Anam avatar you want to use. |
agora_uidstring | The unique identifier for the avatar's RTC connection. This must be different from other participants in the channel. |
agora_tokenstring | The RTC token that authorizes the avatar to join the video channel. Generate this token using your Agora project credentials. |
sample_ratenumber |
The audio sample rate in Hz. |
qualitystring |
The video quality level. |
video_encodingstring |
The video encoding format. |
avatar_modelstring | The Anam avatar model. For example, |
video_widthnumber | The output video width in pixels. Set together with |
video_heightnumber | The output video height in pixels. Set together with |
Caution
The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to Anam without validation. For a full list of supported options, refer to the Anam documentation.
Portrait video
For mobile apps, configure portrait video as follows:
- Set
avatar_modeltocara-4. - Set
video_widthandvideo_heightto a portrait resolution, such as 768 x 1152.
The following resolutions are supported:
| Resolution (width x height) | Orientation | Model |
|---|---|---|
| 720 x 480 | Landscape | Cara 3 |
| 1152 x 768 | Landscape | Cara 4 |
| 768 x 1152 | Portrait | Cara 4 |
Set video_width and video_height together, or omit both to use the default resolution of the avatar model.
AnamAvatar(
api_key='your-anam-key',
avatar_id='<anam_avatar_id>',
avatar_model='cara-4',
video_width=768,
video_height=1152,
)new AnamAvatar({
apiKey: 'your-anam-key',
avatarId: '<anam_avatar_id>',
avatarModel: 'cara-4',
videoWidth: 768,
videoHeight: 1152,
});width, height := 768, 1152
vendors.NewAnamAvatar(vendors.AnamAvatarOptions{
APIKey: "your-anam-key",
AvatarID: "<anam_avatar_id>",
AvatarModel: "cara-4",
VideoWidth: &width,
VideoHeight: &height,
})"avatar": {
"vendor": "anam",
"enable": true,
"params": {
"api_key": "<anam_key>",
"avatar_id": "<anam_avatar_id>",
"agora_uid": "<avatar_rtc_uid>",
"agora_token": "<avatar_rtc_token>",
"avatar_model": "cara-4",
"video_width": 768,
"video_height": 1152
}
}This integration is fully supported for use with Conversational AI Engine. 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.
