The visual avatar is not working. I am using Hedra...
# ask-ai
f
The visual avatar is not working. I am using Hedra. According to the logs, it connects successfully, but neither the avatar is shown nor my speech is registered
t
Thanks for reaching out, Baymurat. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
f
?
t
Hey there! Could you please double-check a few things for me so we can get to the bottom of this: • Are you using a valid Hedra API key, and is it properly set up in your environment or passed during initialization? • When you initialize the
AvatarSession
, have you provided either an
avatar_id
or an
avatar_image
? If you’re using an image, is it a square one (512x512px) with a humanoid face? • Do you see any specific error messages or warnings in the logs besides the connection success message? Once we have these details, it’ll be much easier to figure out what’s going on. Thanks for checking!
f
Here is what I am having in the worker: 2025-08-08 144841 [ INFO] __mp_main__: 📊 Building session config from data: 2025-08-08 144841,118 - INFO __mp_main__ - 📊 Building session config from data: 2025-08-08 144841 [ INFO] __mp_main__: - Has voiceInstructions: True 2025-08-08 144841,118 - INFO __mp_main__ - - Has voiceInstructions: True 2025-08-08 144841 [ INFO] __mp_main__: - Has chat instruction: True 2025-08-08 144841,118 - INFO __mp_main__ - - Has chat instruction: True 2025-08-08 144841 [ INFO] __mp_main__: - Language in data: en 2025-08-08 144841,118 - INFO __mp_main__ - - Language in data: en 2025-08-08 144841 [ INFO] __mp_main__: 🎭 Detected customer persona 2025-08-08 144841,118 - INFO __mp_main__ - 🎭 Detected customer persona 2025-08-08 144841 [ INFO] __mp_main__: 📝 Built instruction (first 200 chars): IMPORTANT: YOU ARE THE CLIENT, NOT THE FINANCIAL ADVISOR You are a potential CLIENT at a second meeting with a financial advisor, considering a specific financial product. You must ALWAYS remain in ... 2025-08-08 144841,118 - INFO __mp_main__ - 📝 Built instruction (first 200 chars): IMPORTANT: YOU ARE THE CLIENT, NOT THE FINANCIAL ADVISOR You are a potential CLIENT at a second meeting with a financial advisor, considering a specific financial product. You must ALWAYS remain in ... 2025-08-08 144841 [ INFO] __mp_main__: 🔊 Voice settings: VoiceSettings(voice_id='aSXZu6bgEOS8MXVRzjPi', stability=0.5, similarity_boost=0.75, speed=1.0) 2025-08-08 144841,118 - INFO __mp_main__ - 🔊 Voice settings: VoiceSettings(voice_id='aSXZu6bgEOS8MXVRzjPi', stability=0.5, similarity_boost=0.75, speed=1.0) 2025-08-08 144841 [ INFO] __mp_main__: 💬 Initial greeting: Hello 2025-08-08 144841,118 - INFO __mp_main__ - 💬 Initial greeting: Hello 2025-08-08 144841 [ INFO] __mp_main__: 🌐 Final session language: en 2025-08-08 144841,118 - INFO __mp_main__ - 🌐 Final session language: en 2025-08-08 144841 [ INFO] __mp_main__: 📝 Instruction starts with: IMPORTANT: YOU ARE THE CLIENT, NOT THE FINANCIAL ... 2025-08-08 144841,118 - INFO __mp_main__ - 📝 Instruction starts with: IMPORTANT: YOU ARE THE CLIENT, NOT THE FINANCIAL ... 2025-08-08 144841 [ DEBUG] PIL.PngImagePlugin: STREAM b'IHDR' 16 13 2025-08-08 144841,138 - DEBUG PIL.PngImagePlugin - STREAM b'IHDR' 16 13 2025-08-08 144841 [ DEBUG] PIL.PngImagePlugin: STREAM b'IDAT' 41 65536 2025-08-08 144841,139 - DEBUG PIL.PngImagePlugin - STREAM b'IDAT' 41 65536 2025-08-08 144841 [ INFO] __mp_main__: 📸 Loaded avatar image from: /Users/baymuratabdumuratov/Documents/aicoach-backend/livekit-service/../car_dealer_512x512.png 2025-08-08 144841,139 - INFO __mp_main__ - 📸 Loaded avatar image from: /Users/baymuratabdumuratov/Documents/aicoach-backend/livekit-service/../car_dealer_512x512.png 2025-08-08 144841 [ DEBUG] livekit.plugins.hedra: starting avatar session 2025-08-08 144841,143 - DEBUG livekit.plugins.hedra - starting avatar session 2025-08-08 144841 [ DEBUG] livekit.agents: http_session(): creating a new httpclient ctx 2025-08-08 144841,162 - DEBUG livekit.agents - http_session(): creating a new httpclient ctx 2025-08-08 144843 [ INFO] __mp_main__: 🎭 Hedra avatar started successfully 2025-08-08 144843,836 - INFO __mp_main__ - 🎭 Hedra avatar started successfully 2025-08-08 144843 [ INFO] __mp_main__: 🔊 Using say method for greeting 2025-08-08 144843,878 - INFO __mp_main__ - 🔊 Using say method for greeting 2025-08-08 144844 [ DEBUG] livekit.agents: waiting for the remote participant 2025-08-08 144844,794 - DEBUG livekit.agents - waiting for the remote participant {"identity": "hedra-avatar-agent"} 2025-08-08 144844 [ INFO] livekit.agents: TTS metrics: ttfb=0.5265234160033287, audio_duration=0.84 2025-08-08 144844,796 - INFO livekit.agents - TTS metrics: ttfb=0.5265234160033287, audio_duration=0.84 2025-08-08 144844 [ DEBUG] livekit.agents: waiting for the remote track 2025-08-08 144844,914 - DEBUG livekit.agents - waiting for the remote track {"identity": "hedra-avatar-agent", "kind": "KIND_VIDEO"} ^[[1;2B2025-08-08 144846 [ DEBUG] livekit.agents: remote participant ready 2025-08-08 144846,894 - DEBUG livekit.agents - remote participant ready {"identity": "hedra-avatar-agent"} ^R 2025-08-08 144852 [ INFO] __mp_main__: Agent ready and running 2025-08-08 144852,399 - INFO __mp_main__ - Agent ready and running
t
It looks like the Hedra avatar session started just fine, but the avatar isn’t showing up or picking up speech. No worries—here are a few things you can try to get it working: • Avatar Image: Make sure your image is a clear, square one (512x512px) with a centered humanoid face. Double-check the
avatar_id
or try swapping in a different image to see if that helps. • Network Connectivity: Take a quick look for any firewall blocks or DNS hiccups that might be stopping Hedra’s API from connecting. Also, confirm that your LiveKit server has proper outbound internet access. • LiveKit Configuration: Check that
LIVEKIT_URL
,
LIVEKIT_API_KEY
, and
LIVEKIT_API_SECRET
are set up correctly. And make sure your LiveKit instance is up and running smoothly. • Participant Identity: Make sure the
avatar_participant_identity
you’re using is unique and not already taken. If you’re still running into trouble, try turning on debug logging in the Hedra plugin and peek at the LiveKit room logs for any errors. You could also test with a simple static image and minimal setup to narrow down what’s going on. Feel free to reach out if you want me to walk you through any of these steps or if you need more help—I’m here for you!
f
what do you mean by this? avatar_participant_identity
t
Hey there! The
avatar_participant_identity
is a handy little parameter in Hedra's
AvatarSession
that gives your avatar a unique ID within a LiveKit session. This ID is what helps create an access token, so your avatar can join the room and be recognized as its own participant. By default, it’s set to
hedra-avatar-agent
, but feel free to change it to something that fits your needs better—like
education-avatar
or any other name that makes sense for you. This way, it’s easier to keep track of and manage multiple avatars in LiveKit. If you want me to walk you through it or have any questions, just let me know—I’m here to help! Sources: livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/avatar.py | avatars/hedra/pipeline_avatar/agent.py | Hedra virtual avatar integration guide | LiveKit Docs
f
what is the difference between avatar_participant_name and avatar_participant_identify?
t
Hey there! Just to help clear things up, the
avatar_participant_identity
and
avatar_participant_name
in Hedra's
AvatarSession
have different roles: • `avatar_participant_identity`: Think of this as a unique ID that LiveKit uses behind the scenes to keep track of the participant's session. It’s usually hidden from users and comes into play when creating the LiveKit access token. By default, it’s set to
hedra-avatar-agent
. • `avatar_participant_name`: This is the friendly name you and others will see in the participant list. You can customize it to whatever makes sense for your use case. By default, it’s also
hedra-avatar-agent
. So, to sum it up: the
identity
is more for internal tracking, while the
name
is what everyone sees. You can set both separately to make sure your avatar’s ID and display name fit your needs. If you want me to walk you through it with examples or have any other questions, just let me know—I’m here to help! Sources: Hedra virtual avatar integration guide | LiveKit Docs
f
is my implemetnation correct? # Load the car dealer image if not os.path.exists(self.avatar_image_path): logger.error(f"Avatar image not found: {self.avatar_image_path}") return None avatar_image = Image.open(self.avatar_image_path) logger.info(f"📸 Loaded avatar image from: {self.avatar_image_path}") # Create Hedra avatar session avatar = hedra.AvatarSession( avatar_image=avatar_image, avatar_participant_identity="agent-hedra-avatar", # Add this line avatar_participant_name="hedra-avatar-agent", api_key=self.config.hedra_api_key, )
t
Your implementation of the Hedra
AvatarSession
looks spot on! Here’s a quick rundown of the important parts: • `avatar_image`: You’re doing great by loading the image with `Image.open`—this is exactly what’s needed to generate the avatar if you’re not using
avatar_id
. • `avatar_participant_identity`: Setting this to
"agent-hedra-avatar"
is perfect for giving the avatar participant a unique ID in the LiveKit session. • `avatar_participant_name`: Using
"hedra-avatar-agent"
here gives a nice, friendly name for the avatar—nice touch! • `api_key`: Passing the API key through
self.config.hedra_api_key
is just right to make sure everything authenticates smoothly with Hedra’s API. Everything you’ve set up matches the official guidelines for starting a Hedra avatar session. If you hit any snags or want to chat more about it, just let me know—I’m here to help! Sources: livekit-plugins/livekit-plugins-simli/livekit/plugins/simli/avatar.py