LemonSlice
Updated
Use a LemonSlice avatar to represent your agent on video in a Conversational AI Platform agent.
Preview documentation
LemonSlice provides AI-powered avatar agents that generate synchronized video and audio responses in real time, enabling natural video conversations with your AI agents.
Sample configuration
The following example shows how to configure LemonSlice as the agent's avatar when you create or update an agent. For a complete example, see Create an agent and start a session.
LemonSlice supports BYOK only. It isn't available in managed mode. Store your LemonSlice 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, LemonSlice, 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 your TTS vendor
.with_avatar(
LemonSlice(
api_key=secret_ref("support_prod", "lemonslice"),
api_base_url="https://lemonslice.com/api/liveai/agora",
avatar_id="lemonslice",
agora_uid="<avatar_rtc_uid>",
agora_token="<avatar_rtc_token>",
additional_params={
"agent_image_url": "<image_url>",
"aspect_ratio": "2x3",
},
)
)
)import { Agent, LemonSlice, 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 your TTS vendor */)
.withAvatar(
new LemonSlice({
apiKey: secretRef('support_prod', 'lemonslice'),
apiBaseUrl: 'https://lemonslice.com/api/liveai/agora',
avatarId: 'lemonslice',
agoraUid: '<avatar_rtc_uid>',
agoraToken: '<avatar_rtc_token>',
agentImageUrl: '<image_url>',
aspectRatio: '2x3',
}),
);// client is your configured Agora client
agent := agentkit.NewAgent(client).
WithStt( /* configure your ASR vendor */ ).
WithLlm( /* configure your LLM vendor */ ).
WithTts( /* configure your TTS vendor */ ).
WithAvatar(vendors.NewLemonSlice(vendors.LemonSliceOptions{
APIKey: agentkit.SecretRef("support_prod", "lemonslice"),
APIBaseURL: "https://lemonslice.com/api/liveai/agora",
AvatarID: "lemonslice",
AgoraUID: "<avatar_rtc_uid>",
AgoraToken: "<avatar_rtc_token>",
AdditionalParams: map[string]interface{}{
"agent_image_url": "<image_url>",
"aspect_ratio": "2x3",
},
}))Add an avatar block to the pipeline. LemonSlice uses the generic avatar vendor. Set credential.mode to byok and credential.fields.api_key to the reference. In the following example, the key is stored as lemonslice in the support_prod set:
"avatar": {
"enabled": true,
"credential": {
"mode": "byok",
"fields": {
"api_key": "$secrets.support_prod.lemonslice"
}
},
"vendor": "generic",
"params": {
"api_base_url": "https://lemonslice.com/api/liveai/agora",
"avatar_id": "lemonslice",
"agent_image_url": "<image_url>",
"agora_token": "<avatar_rtc_token>",
"agora_uid": "<avatar_rtc_uid>",
"aspect_ratio": "2x3"
}
}Key parameters
The avatar block takes the following fields. In the SDKs, LemonSlice sets them from its options, and passes any other parameters from its additional parameters option to params.
enabledbooleanSet to true to show the avatar.
vendorstringSet to generic.
credentialobjectSet mode to byok and fields.api_key to a $secrets.<set>.<key> reference to your LemonSlice API key. Get your API key from your LemonSlice account.
paramsobjectapi_base_urlstringThe base URL of the LemonSlice API endpoint. Set to https://lemonslice.com/api/liveai/agora.
avatar_idstringFixed value that identifies the vendor integration. Always set to lemonslice.
agent_image_urlstringA publicly accessible URL to the avatar image. Provide exactly one of agent_id, agent_image_url, or agent_image_base64.
agent_idstringThe ID of a LemonSlice agent to use as the avatar. Provide exactly one of agent_id, agent_image_url, or agent_image_base64. If you provide agent_id, LemonSlice also uses that agent's configured settings as defaults for agent_prompt and agent_idle_prompt.
agent_image_base64stringA base64-encoded avatar image. Provide exactly one of agent_id, agent_image_url, or agent_image_base64.
aspect_ratiostringThe output aspect ratio for the avatar video. One of 2x3, 9x16, or 1x1. Defaults to 2x3.
agora_tokenstringThe RTC token that authorizes the avatar to join the video channel. Generate this token using your Agora project credentials.
agora_uidstringThe unique identifier for the avatar's RTC connection. This must be different from other participants in the channel.
For advanced configuration options, refer to the LemonSlice Agora integration page or the LemonSlice API 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.
