i
hi
t
Thanks for reaching out, Raj. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi — how can I help today? What are you trying to do with LiveKit (SDK, server setup, rooms, permissions, recording, or something else)?
i
how do i integrate nova sonic realtime to liveavatar on livit room using python
t
You're asking how to integrate Amazon Nova Sonic Realtime with LiveAvatar in a LiveKit room using Python — I can guide you through that. To give the most useful steps and a concise example, I need two quick details: 1. Are you using the LiveKit Agents framework (AgentSession) or a custom LiveKit server/client setup? 2. Do you already have Nova Sonic and LiveAvatar credentials and avatars configured (AWS keys + LiveAvatar API key and avatar ID)? If you confirm those, I’ll provide a short Python example showing: • required packages and env vars, • creating the
AgentSession
with Nova Sonic, • starting the
AvatarSession
and routing agent audio to the avatar, • the minimal room start sequence (avatar first, agent with audio disabled). Sources: Amazon Nova Sonic integration guide | LiveKit docs | LiveAvatar virtual avatar integration guide | LiveKit docs | Virtual avatar plugins | LiveKit Docs | Bringing AI avatars to voice agents | examples/avatar_agents | livekit/livekit_composite | DeepWiki
i
1. im creating the room from livkit and assiging the keys to participants using async function createLiveKitRoom(roomName) { try { const res = await roomClient.createRoom({ name: roomName, emptyTimeout: 2 * 60, //10mins maxParticipants: 3, }); return res; } catch (err) { console.log('">>>>>>>>>>>>LIVE ROOM CREATION', err); if (err?.message?.includes("already exists")) { return null; } throw err; } } and 2 i do have AWS keys + LiveAvatar API key and avatar ID)
t
Thanks — since you create rooms via LiveKit and already have AWS + LiveAvatar creds, here’s a minimal, practical Python pattern that matches your flow: it starts the LiveAvatar session first, uses Nova Sonic Realtime as the agent LLM, and routes agent audio to the avatar (agent audio disabled for direct room publish). Replace placeholders with your keys/IDs. Prerequisites • Install plugins: ◦ livekit-agents with LiveAvatar plugin and AWS realtime support via your package manager (example uses the same plugin names you added earlier). • Env vars: ◦ AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY ◦ LIVEAVATAR_API_KEY, LIVEAVATAR_AVATAR_ID ◦ LIVEKIT_API_KEY, LIVEKIT_API_SECRET, LIVEKIT_URL (for server-side control) Minimal Python example (AgentSession + LiveAvatar)
Copy code
# Replace imports with the actual package names you installed
from livekit.agents import AgentSession, RoomOutputOptions
from livekit.plugins import aws, liveavatar
from livekit.server import LiveKitRoomContext  # pseudo import for context/room access

async def handle_agent_in_room(ctx: LiveKitRoomContext):
    # 1) Create the AgentSession using Nova Sonic realtime model
    agent_session = AgentSession(
        llm=aws.realtime.RealtimeModel(),  # Nova Sonic Realtime model
        # add other configs you need (STT, VAD), Nova Sonic provides VAD/turn detection
    )

    # 2) Create the LiveAvatar session (avatar_id from env or config)
    avatar_session = liveavatar.AvatarSession(avatar_id="YOUR_LIVEAVATAR_AVATAR_ID")

    # 3) Start Avatar session first so it can accept audio stream from the agent
    # avatar.start will attach the avatar as a participant and prepare to publish AV tracks
    await avatar_session.start(agent_session, room=ctx.room)

    # 4) Start AgentSession but disable direct audio output to room
    # audio should be delivered to LiveAvatar instead of published by agent directly
    await agent_session.start(
        room=ctx.room,
        room_output_options=RoomOutputOptions(audio_enabled=False)
    )

    # 5) Run your agent loop / handle events as needed
    # e.g., await agent_session.run() or listen for incoming audio events per framework
Key points to match your JS room creation flow • Create the LiveKit room and issue participant tokens as you already do from JS. The avatar and agent run server-side and join the same room using server credentials or SDK helper functions. • Start the LiveAvatar session before starting the AgentSession. LiveAvatar will accept the agent audio via LiveKit ByteStream and publish synchronized video+audio tracks into the room. • Use
RoomOutputOptions(audio_enabled=False)
(or equivalent) so the agent does not publish raw audio into the room — the avatar publishes rendered audio+video instead. • Nova Sonic handles turn detection/VAD; you usually don’t need an extra VAD unless you have a custom STT pipeline. Frontend considerations • In your frontend, detect the avatar participant (the avatar will appear as a separate participant) and render its audio+video tracks. • If you publish on behalf of the avatar participant, ensure your token/permissions are set so the avatar participant can publish tracks from the server-side worker. If you’d like, I can: • Provide a more complete runnable example showing LiveKit server join and token usage for the avatar participant. • Show how to generate the server-side join token for the avatar participant (matching your JS token creation flow). Which would you prefer?
i
livekit-agents livekit-plugins-aws[realtime] python-dotenv these plugins i have installed anything else i need to install?
t
You're almost set. You have the packages needed for Nova Sonic realtime support and env var loading. To add LiveAvatar support install the LiveAvatar extras for livekit-agents: 1. Install LiveAvatar plugin:
Copy code
uv add "livekit-agents[liveavatar]~=1.3.6"
1. Ensure these env vars are set (use
.env
if helpful): •
AWS_ACCESS_KEY_ID
•
AWS_SECRET_ACCESS_KEY
•
LIVEAVATAR_API_KEY
•
LIVEAVATAR_AVATAR_ID
•
LIVEKIT_API_KEY
•
LIVEKIT_API_SECRET
•
LIVEKIT_URL
If you want, I can now: • provide a runnable Python example that joins the room, starts the avatar, and starts the agent with Nova Sonic, or • show how to generate server-side join tokens for the avatar participant to match your JS room creation flow. Which would you like? Sources: Voice AI quickstart | LiveKit docs | Amazon Nova Sonic integration guide | LiveKit docs | LiveAvatar virtual avatar integration guide | LiveKit docs
i
i dont need this because when i livkit room with its credentials and liveavatar credentials avatar is able to join the room and now i want to give it a voice with sts realmtime nova sonic
t
Great — since the avatar already joins the LiveKit room, here’s the minimal Python pattern to give it a Nova Sonic realtime voice. This assumes you already have AWS and LiveAvatar creds loaded. 1) Imports & model/session setup
Copy code
from livekit.agents import AgentSession, RoomOutputOptions
from livekit.plugins import aws, liveavatar

# Nova Sonic realtime model (choose voice/region if desired)
llm = aws.realtime.RealtimeModel(voice="Ivy", region="us-east-1")

# Agent session using Nova Sonic (no separate STT/TTS needed)
agent_session = AgentSession(llm=llm)
2) Create/start the LiveAvatar session (avatar is already in the room as a participant)
Copy code
avatar = liveavatar.AvatarSession(avatar_id="YOUR_LIVEAVATAR_AVATAR_ID")

# Start avatar first so it can accept audio from the agent session
await avatar.start(agent_session, room=ctx.room)
3) Start the agent session and route audio to avatar
Copy code
# Disable direct agent audio publishing; avatar will publish synchronized AV
await agent_session.start(
    room=ctx.room,
    room_output_options=RoomOutputOptions(audio_enabled=False)
)
4) Run agent loop / handle events (example depends on your app) • Let the AgentSession process incoming audio; Nova Sonic will generate realtime audio responses. • LiveAvatar worker will consume that audio and publish synced video+audio tracks to the room. Key notes • Nova Sonic replaces separate STT/TTS — it handles input and generates spoken output. • Start Avatar before Agent so the avatar worker can receive the agent’s audio stream. • Keep
audio_enabled=False
on the agent so only the avatar publishes the rendered audio+video. • Ensure env vars are set:
AWS_ACCESS_KEY_ID
,
AWS_SECRET_ACCESS_KEY
,
LIVEAVATAR_API_KEY
,
LIVEAVATAR_AVATAR_ID
, and your LiveKit server creds. Want a runnable example that shows server-side room join and token usage for the avatar participant? Sources: Amazon Nova Sonic integration guide | LiveKit docs | LiveAvatar virtual avatar integration guide | LiveKit docs | Virtual avatar plugins | LiveKit Docs | Bringing AI avatars to voice agents
i
to pass audio to avatar how wud i do that?
t
Short answer: you don't manually pass audio — the Agents framework routes Nova Sonic's audio to LiveAvatar automatically when both are attached to the same AgentSession. How it works (concise) • Use
aws.realtime.RealtimeModel()
as the
llm
in your
AgentSession
. Nova Sonic generates realtime spoken audio. • Create a
liveavatar.AvatarSession(avatar_id=...)
and call
await avatar.start(agent_session, room=ctx.room)
. • Start the
AgentSession
(with
RoomOutputOptions(audio_enabled=False)
so the agent itself doesn't publish audio). The avatar worker receives the agent's audio stream, synthesizes lip‑synced video, and publishes the avatar's audio+video tracks to the room. Minimal reminder (code)
Copy code
llm = aws.realtime.RealtimeModel(voice="Ivy")
agent = AgentSession(llm=llm)
avatar = liveavatar.AvatarSession(avatar_id="YOUR_AVATAR_ID")
await avatar.start(agent, room=ctx.room)
await agent.start(room=ctx.room, room_output_options=RoomOutputOptions(audio_enabled=False))
If you want, I can: • provide a runnable example showing server join and token usage, or • show how to verify in the frontend which participant is the avatar and how to play its audio/video tracks. Which do you prefer? Sources: Amazon Nova Sonic integration guide | LiveKit docs | LiveAvatar virtual avatar integration guide | LiveKit docs | Bringing AI avatars to voice agents | Tavus virtual avatar integration guide | LiveKit docs | Virtual avatar plugins | LiveKit Docs
i
whos giving this ctx
t
ctx
is the server-side context object supplied by the LiveKit Agents runtime when your handler is invoked. It comes from the decorator/entrypoint that runs your agent job (for example
@server.rtc_session()
or similar) and contains the room and participant information the handler should use. Typical contents you’ll rely on: •
ctx.room
— the LiveKit room object (used when starting avatar/agent sessions) •
ctx.participant
or
ctx.client
— the participant that triggered the session (if applicable) • other job metadata (IDs, request info) provided by the runtime Example pattern:
Copy code
@server.rtc_session()
async def my_agent(ctx):
    # ctx is injected by the LiveKit Agents runtime
    room = ctx.room
    # start avatar/agent using room
    await avatar.start(agent_session, room=room)
    await agent_session.start(room=room, ...)
If you tell me which server decorator or framework entrypoint you’re using (e.g.,
@server.rtc_session()
or a custom job handler), I’ll give the exact handler signature and a short runnable example.
i
so when i will run this .py file what next what do i need to pass
t
When you run the Python agent file, you don’t manually pass
ctx
— the LiveKit Agents runtime invokes your handler and injects
ctx
(room, participant, etc.). What you must do when running the script is ensure the runtime environment and entrypoint are set up so the framework can start your job. Minimal checklist and steps to run: 1. Env vars (set these before running) • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION • LIVEAVATAR_API_KEY, LIVEAVATAR_AVATAR_ID • LIVEKIT_API_KEY, LIVEKIT_API_SECRET, LIVEKIT_URL 1. Implement the handler with the runtime decorator (example)
Copy code
from livekit.agents import server, AgentSession, RoomOutputOptions
from livekit.plugins import aws, liveavatar

llm = aws.realtime.RealtimeModel(voice="Ivy")
agent_session = AgentSession(llm=llm)
avatar = liveavatar.AvatarSession(avatar_id="YOUR_AVATAR_ID")

@server.rtc_session()
async def my_agent(ctx):
    await avatar.start(agent_session, room=ctx.room)
    await agent_session.start(room=ctx.room, room_output_options=RoomOutputOptions(audio_enabled=False))
    # handle agent loop / events here
1. Start the agent runtime/process • Run the Python process that registers the handler (e.g., python main.py). The Agents runtime inside that process listens for job invocations from LiveKit and will call
my_agent(ctx)
when the server triggers it. 1. Triggering the handler (how ctx is created) • The runtime creates
ctx
and calls your handler when a job starts. Typical triggers: ◦ A participant joins the room and you configured the server to start an agent on join. ◦ An external API/webhook you control calls the Agents runtime to start the job. ◦ A scheduled or programmatic server-side call that enqueues the agent job. • If you currently create the LiveKit room and tokens from your JS flow, ensure your server-side runtime is configured to start the agent when the avatar participant should be driven (e.g., on participant join or via an API call). 1. What you must provide yourself • How the job is triggered (participant join, API call, or other). If you want to manually start a job for testing, expose a lightweight HTTP endpoint that calls the runtime to start
my_agent
for a specific room, or programmatically start it from the same process. Would you like: • a runnable example that includes a simple HTTP endpoint to start the agent for a given room id (useful for testing), or • instructions for starting the agent automatically when a participant joins the room?
i
why do i need liveavtar plugin?
t
Good question — here’s why the LiveAvatar plugin is needed (and what happens if you skip it). • LiveAvatar creates the avatar participant in the room and runs the avatar worker that synthesizes lip‑synced video from the agent’s audio. • When you use Nova Sonic as the agent LLM, Nova Sonic produces the realtime audio; the LiveAvatar plugin consumes that audio, generates synchronized video frames, and publishes the avatar’s audio+video tracks to the room. • Without the LiveAvatar plugin you still get Nova Sonic’s audio (the agent can speak), but there’s no avatar worker to render video or publish a separate avatar participant — you’ll have audio-only output from the agent. If you only want voice (no video/avatar), you can skip the LiveAvatar plugin and let the agent publish audio directly. If you want both voice and a visual avatar, you need LiveAvatar so the audio is converted into a lip‑synced avatar participant. Would you like a minimal example for audio-only, or the full avatar+audio setup?
i
import os from dotenv import load_dotenv import requests load_dotenv("agent.env") from livekit.agents import WorkerOptions, cli, Agent, AutoSubscribe, AgentSession, RoomOutputOptions from livekit.plugins import aws # LIVEKIT_URL = os.getenv("LIVEKIT_URL") # AGENT_TOKEN = os.getenv("AGENT_TOKEN") # def fetch_agent_token(): # url = f"http://localhost:3000/livekit/setup" # resp = requests.post(url) # resp.raise_for_status() # return resp.json() # setup_info = fetch_agent_token() # print("<<<<<<<<<<SERVER URL", setup_info) # AGENT_TOKEN = setup_info["agentToken"] # LIVEKIT_URL = setup_info["serverUrl"] async def entrypoint(ctx): print("🔊 Connecting agent to LiveKit…") await ctx.connect( url=LIVEKIT_URL, token=AGENT_TOKEN, auto_subscribe=AutoSubscribe.AUDIO_ONLY ) print("🤖 Connected as:", ctx.room.local_participant.identity) # Voice AI agent instructions agent = Agent( instructions=( "You are an interview assistant. " "Keep responses short and conversational." ) ) # Nova Sonic Realtime model session = AgentSession( llm=aws.realtime.RealtimeModel( voice="tiffany", region="us-east-1", access_key_id=os.getenv("AWS_ACCESS_KEY_ID"), secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"), ) ) # Start Voice Conversation Loop await session.start( room=ctx.room, agent=agent, room_output_options=RoomOutputOptions(audio_enabled=False) ) print("🎤 Nova Sonic voice session started.") if name == "__main__": cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
t
Thanks — based on your script and question, here’s a concise corrected version that shows exactly how to attach Nova Sonic audio to a LiveAvatar in the room and how to run it. It includes the LiveAvatar session start, required env vars, and the minimal runtime flow. 1) Ensure env vars (agent.env) • LIVEKIT_URL • AGENT_TOKEN • AWS_ACCESS_KEY_ID • AWS_SECRET_ACCESS_KEY • AWS_REGION (optional, default: us-east-1) • LIVEAVATAR_API_KEY • LIVEAVATAR_AVATAR_ID 2) Minimal runnable Python agent (replace placeholders)
Copy code
import os
from dotenv import load_dotenv

load_dotenv("agent.env")

from livekit.agents import WorkerOptions, cli, AgentSession, RoomOutputOptions
from livekit.plugins import aws, liveavatar
from livekit import rtc

LIVEKIT_URL = os.getenv("LIVEKIT_URL")
AGENT_TOKEN = os.getenv("AGENT_TOKEN")

async def entrypoint(ctx):
    # connect the server-side worker into the room (ctx injected by runtime)
    await ctx.connect(url=LIVEKIT_URL, token=AGENT_TOKEN, auto_subscribe=rtc.AutoSubscribe.AUDIO_ONLY)

    # Nova Sonic realtime model as the agent LLM
    agent_session = AgentSession(
        llm=aws.realtime.RealtimeModel(
            voice="tiffany",
            region=os.getenv("AWS_REGION", "us-east-1"),
            access_key_id=os.getenv("AWS_ACCESS_KEY_ID"),
            secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"),
        )
    )

    # LiveAvatar session (avatar joins room as a participant)
    avatar = liveavatar.AvatarSession(avatar_id=os.getenv("LIVEAVATAR_AVATAR_ID"))

    # Start avatar first so it can receive the agent audio stream
    await avatar.start(session=agent_session, room=ctx.room)

    # Start agent session; disable direct agent audio publishing so avatar publishes AV
    await agent_session.start(room=ctx.room, room_output_options=RoomOutputOptions(audio_enabled=False))

    # Keep the process alive / handle agent events per your logic
    await agent_session.wait()  # or your own event loop

if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
3) What you run and what happens • Run: python your_script.py (the Agents runtime inside this process registers the entrypoint). • You do NOT pass
ctx
manually — the runtime injects it when it invokes
entrypoint
. • Triggering the job: the runtime will call your entrypoint when configured (e.g., on participant join, or when you start the job programmatically). For testing, you can start the worker then trigger a server-side API or configured hook that starts the agent job for the room. 4) How audio gets to the avatar • Nova Sonic (the
aws.realtime.RealtimeModel
) generates the spoken audio. • Passing
session
to
avatar.start(...)
wires the agent’s audio stream to the LiveAvatar worker automatically. • Setting
RoomOutputOptions(audio_enabled=False)
prevents the agent from publishing raw audio to the room; the avatar publishes the rendered audio+video tracks instead. If you’d like, I can: • provide a small HTTP endpoint example to trigger the agent for a specific room (useful for testing), or • show how to start the agent automatically when a participant joins. Which do you prefer? Sources: Amazon Nova Sonic integration guide | LiveKit docs | LiveAvatar virtual avatar integration guide | LiveKit docs | Virtual avatar plugins | LiveKit Docs
i
python trial1.py start Traceback (most recent call last): File "C:\Users\MalayarajMaity\IG_repos\genai-trial\4hira-avatar\voice-agent\trial1.py", line 7, in <module> from livekit.plugins import aws, liveavatar ImportError: cannot import name 'liveavatar' from 'livekit.plugins' (unknown location)
t
You hit the import error because the LiveAvatar plugin package isn’t installed in your Python environment. Fix: 1) Install the LiveAvatar extras:
Copy code
uv add "livekit-agents[liveavatar]~=1.3.6"
Or with pip:
Copy code
pip install "livekit-plugins-liveavatar>=1.3.6"
2) Verify installation (pip):
Copy code
pip show livekit-plugins-liveavatar
3) Restart your terminal/IDE and re-run:
Copy code
python trial1.py start
If you still see the ImportError: • Confirm you are using the same Python interpreter/environment where the package was installed (virtualenv / venv / conda). • Run
python -m pip list | grep livekit
to confirm packages for that interpreter. • If using an editor, ensure it’s using the same interpreter (check interpreter path). When imports succeed, your code can use:
Copy code
from livekit.plugins import aws, liveavatar
Want me to: • provide the exact pip/uv commands for your current environment, or • help verify which Python interpreter your editor/terminal is using? Sources: LiveAvatar virtual avatar integration guide | LiveKit docs
i
python trial1.py start {"level": "ERROR", "name": "livekit.agents", "message": "worker failed", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\agents\\cli\\cli.py\", line 1342, in _worker_run\n await server.run(devmode=args.devmode, unregistered=jupyter)\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\agents\\worker.py\", line 606, in run\n raise ValueError(\"api_key is required, or add LIVEKIT_API_KEY in your environment\")\nValueError: api_key is required, or add LIVEKIT_API_KEY in your environment", "timestamp": "2025-12-11T091548.771089+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "draining worker", "id": "unregistered", "timeout": 1800, "timestamp": "2025-12-11T091548.772651+00:00"} ╭──────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────╮ │ C\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site packages\livekit\agents\cli\cli.py1491 in start │ │ │ │ 1488 │ │ if drain_timeout is not None: │ │ 1489 │ │ │ server.update_options(drain_timeout=drain_timeout) │ │ 1490 │ │ │ │ ❱ 1491 │ │ _run_worker( │ │ 1492 │ │ │ server=server, │ │ 1493 │ │ │ args=proto.CliArgs( │ │ 1494 │ │ │ │ log_level=log_level.value, url=url, api_key=api_key, api_secret=api_secr │ │ │ │ ╭───────────────────────────────────── locals ─────────────────────────────────────╮ │ │ │ api_key = None │ │ │ │ api_secret = None │ │ │ │ drain_timeout = None │ │ │ │ log_level = <LogLevel.info: 'INFO'> │ │ │ │ server = <livekit.agents.worker.AgentServer object at 0x000002D79CDBFD30> │ │ │ │ url = 'wss://mraj-hira2-d9duewbs.livekit.cloud' │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site packages\livekit\agents\cli\cli.py1365 in _run_worker │ │ │ │ 1362 │ │ │ if not args.devmode: │ │ 1363 │ │ │ │ loop.run_until_complete(server.drain()) │ │ 1364 │ │ │ │ │ ❱ 1365 │ │ │ loop.run_until_complete(server.aclose()) │ │ 1366 │ │ │ │ │ 1367 │ │ │ if watch_client: │ │ 1368 │ │ │ │ loop.run_until_complete(watch_client.aclose()) │ │ │ │ ╭──────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │ │ │ args = CliArgs( │ │ │ │ │ log_level='INFO', │ │ │ │ │ url='wss://mraj-hira2-d9duewbs.livekit.cloud', │ │ │ │ │ api_key=None, │ │ │ │ │ api_secret=None, │ │ │ │ │ devmode=False, │ │ │ │ │ reload=False, │ │ │ │ │ reload_count=0, │ │ │ │ │ mp_cch=None │ │ │ │ ) │ │ │ │ c = None │ │ │ │ exit_triggered = False │ │ │ │ jupyter = False │ │ │ │ loop = <ProactorEventLoop running=False closed=True debug=False> │ │ │ │ main_task = <Task finished name='worker_main_task_cli' coro=<_run_worker.<locals>._worker_run() done, defined at
t
The error shows the worker needs LiveKit server credentials. The Agents runtime requires either CLI flags or these env vars:
LIVEKIT_API_KEY
and
LIVEKIT_API_SECRET
(or `AGENT_TOKEN`/`LIVEKIT_URL` depending on your flow). Set them and re-run. Quick steps to fix 1) Add server credentials to your agent.env (or export in shell):
Copy code
LIVEKIT_API_KEY=your_server_api_key
LIVEKIT_API_SECRET=your_server_api_secret
LIVEKIT_URL=wss://your-livekit-host
AGENT_TOKEN=<optional agent token if you use token-based connect>
2) Confirm file is loaded by your script (you use load_dotenv("agent.env")). 3) Re-run the worker:
Copy code
python trial1.py start
Notes • If you prefer passing credentials via CLI instead of env vars: python trial1.py start --api-key <key> --api-secret <secret> --url wss://your-livekit-host •
AGENT_TOKEN
is used when the worker connects into a specific room;
LIVEKIT_API_KEY/SECRET
are required for the runtime to create tokens or manage server-side operations. • If you need, I can: ◦ show how to generate a server API key/secret from your LiveKit cloud dashboard, or ◦ update your script to fall back to CLI args and print loaded env vars for debugging. Which would help more?
i
python trial1.py start {"level": "INFO", "name": "livekit.agents", "message": "starting worker", "version": "1.3.6", "rtc-version": "1.0.20", "timestamp": "2025-12-11T091919.304621+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "HTTP server listening on :8081", "timestamp": "2025-12-11T091919.304621+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "initializing job runner", "tid": 19300, "timestamp": "2025-12-11T091919.307215+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "initializing job runner", "tid": 33504, "timestamp": "2025-12-11T091919.307215+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "initializing job runner", "tid": 10612, "timestamp": "2025-12-11T091919.307215+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "initializing job runner", "tid": 24508, "timestamp": "2025-12-11T091919.307215+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 19300, "elapsed_time": 0.0, "timestamp": "2025-12-11T091919.311536+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 10612, "elapsed_time": 0.0, "timestamp": "2025-12-11T091919.313402+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 24508, "elapsed_time": 0.0, "timestamp": "2025-12-11T091919.313961+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 33504, "elapsed_time": 0.0, "timestamp": "2025-12-11T091919.313961+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "registered worker", "agent_name": "", "id": "AW_938aXHXmY9dG", "url": "wss://mraj-hira2-d9duewbs.livekit.cloud", "region": "India South", "protocol": 16, "timestamp": "2025-12-11T091919.354337+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "received job request", "job_id": "AJ_PdwJygCwWTVy", "dispatch_id": "AD_s7LMkEktxMey", "room": "interview-1765444723551", "room_id": "RM_MFVE4G4bpvti", "agent_name": "", "resuming": false, "enable_recording": false, "timestamp": "2025-12-11T091919.375721+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "received job request", "job_id": "AJ_JBGqEwHUqurE", "dispatch_id": "AD_r2prRt8fjNqZ", "room": "interview-1765444722564", "room_id": "RM_ipNxjk8fSEuU", "agent_name": "", "resuming": false, "enable_recording": false, "timestamp": "2025-12-11T091919.376283+00:00"} {"level": "ERROR", "name": "livekit.agents", "message": "unhandled exception while running the job task", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\opentelemetry\\util\\_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\agents\\ipc\\job_proc_lazy_main.py\", line 286, in _traceable_entrypoint\n await self._job_entrypoint_fnc(job_ctx)\n File \"C:\\Users\\MalayarajMaity\\IG_repos\\genai-trial\\4hira-avatar\\voice-agent\\trial1.py\", line 15, in entrypoint\n await ctx.connect(url=LIVEKIT_URL, token=AGENT_TOKEN, auto_subscribe=rtc.AutoSubscribe.AUDIO_ONLY)\nAttributeError: module 'livekit.rtc' has no attribute 'AutoSubscribe'", "timestamp": "2025-12-11T091919.388816+00:00"} {"level": "ERROR", "name": "livekit.agents", "message": "unhandled exception while running the job task", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\opentelemetry\\util\\_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\agents\\ipc\\job_proc_lazy_main.py\", line 286, in _traceable_entrypoint\n await self._job_entrypoint_fnc(job_ctx)\n File \"C:\\Users\\MalayarajMaity\\IG_repos\\genai-trial\\4hira-avatar\\voice-agent\\trial1.py\", line 15, in entrypoint\n await ctx.connect(url=LIVEKIT_URL, token=AGENT_TOKEN, auto_subscribe=rtc.AutoSubscribe.AUDIO_ONLY)\nAttributeError: module 'livekit.rtc' has no attribute 'AutoSubscribe'", "timestamp": "2025-12-11T091919.388816+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "initializing job runner", "tid": 24332, "timestamp": "2025-12-11T091919.420138+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "initializing job runner", "tid": 35964, "timestamp": "2025-12-11T091919.420138+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 24332, "elapsed_time": 0.0, "timestamp": "2025-12-11T091919.422577+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 35964, "elapsed_time": 0.0, "timestamp": "2025-12-11T091919.422577+00:00"}
t
You're almost there — the recent errors show two issues: wrong import for AutoSubscribe and missing/incorrect env vars or tokens in places. Here's a focused checklist and the minimal fixes so your script runs cleanly. 1) Fix the AutoSubscribe import/use • Use AutoSubscribe from livekit.agents, not livekit.rtc. In your script call:
Copy code
await ctx.connect(
    url=LIVEKIT_URL,
    token=AGENT_TOKEN,
    auto_subscribe=livekit.agents.AutoSubscribe.AUDIO_ONLY
)
Or import it:
Copy code
from livekit.agents import AutoSubscribe
...
auto_subscribe=AutoSubscribe.AUDIO_ONLY
2) Ensure required env vars are present In agent.env (or environment): • LIVEKIT_URL • AGENT_TOKEN (or LIVEKIT_API_KEY & LIVEKIT_API_SECRET if you need server APIs) • AWS_ACCESS_KEY_ID • AWS_SECRET_ACCESS_KEY • AWS_REGION (optional) • LIVEAVATAR_API_KEY • LIVEAVATAR_AVATAR_ID 3) Confirm installed packages (same interpreter used to run script) • livekit-agents with aws and liveavatar extras:
Copy code
uv add "livekit-agents[aws, liveavatar]~=1.3.6"
or
Copy code
pip install "livekit-plugins-liveavatar>=1.3.6"
Then restart terminal/IDE. 4) Minimal corrected flow (concept) • Connect: ctx.connect(..., auto_subscribe=AutoSubscribe.AUDIO_ONLY) • Create AgentSession with aws.realtime.RealtimeModel(...) • Create AvatarSession with liveavatar.AvatarSession(avatar_id=...) • await avatar.start(session, room=ctx.room) • await agent_session.start(room=ctx.room, room_output_options=RoomOutputOptions(audio_enabled=False)) 5) Debug tips if you still see errors • Print loaded env vars at top of entrypoint to confirm they're present. • Run
python -m pip list | grep livekit
to confirm packages for that interpreter. • If using AGENT_TOKEN ensure it has room-join permissions for the room you got a job for. If you want, I can: • provide a one-file runnable example with the AutoSubscribe fix and env-var checks, or • review the exact trial1.py you have (paste it) and point out the minimal edits. Which would you prefer? Sources: Amazon Nova Sonic integration guide | LiveKit docs | LiveAvatar virtual avatar integration guide | LiveKit docs | OpenAI and LiveKit partner to turn Advanced Voice into an API | Job lifecycle | LiveKit docs | OpenAI and LiveKit partner to turn Advanced Voice into an API
i
{"level": "INFO", "name": "livekit.agents", "message": "registered worker", "agent_name": "", "id": "AW_hj88VEWTZe2k", "url": "wss://mraj-hira2-d9duewbs.livekit.cloud", "region": "India South", "protocol": 16, "timestamp": "2025-12-11T092457.860020+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "received job request", "job_id": "AJ_CZAdR4VKiRYw", "dispatch_id": "AD_mBgkgAsCpBth", "room": "interview-1765445073777", "room_id": "RM_rwtZTFWRT5mN", "agent_name": "", "resuming": false, "enable_recording": false, "timestamp": "2025-12-11T092457.880710+00:00"} {"level": "ERROR", "name": "livekit.agents", "message": "unhandled exception while running the job task", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\opentelemetry\\util\\_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\agents\\ipc\\job_proc_lazy_main.py\", line 286, in _traceable_entrypoint\n await self._job_entrypoint_fnc(job_ctx)\n File \"C:\\Users\\MalayarajMaity\\IG_repos\\genai-trial\\4hira-avatar\\voice-agent\\trial1.py\", line 15, in entrypoint\n await ctx.connect(url=LIVEKIT_URL, token=AGENT_TOKEN, auto_subscribe=AutoSubscribe.AUDIO_ONLY)\nTypeError: JobContext.connect() got an unexpected keyword argument 'url'", "timestamp": "2025-12-11T092457.894139+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "initializing job runner", "tid": 34824, "timestamp": "2025-12-11T092457.938804+00:00"} {"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 34824, "elapsed_time": 0.0, "timestamp": "2025-12-11T092457.940198+00:00"}
t
You're now registering and receiving job requests — good. The current failure is: TypeError: JobContext.connect() got an unexpected keyword argument 'url' Fix: when your agent is started by LiveKit (job dispatched), the runtime injects connection details into the JobContext. Do not pass url or token to ctx.connect(). Call ctx.connect(...) only with options (e.g., auto_subscribe). Change this line:
Copy code
await ctx.connect(url=LIVEKIT_URL, token=AGENT_TOKEN, auto_subscribe=AutoSubscribe.AUDIO_ONLY)
to:
Copy code
await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)
Quick checklist after that: • Ensure AutoSubscribe is imported from livekit.agents:
Copy code
from livekit.agents import AutoSubscribe
• Start avatar and agent after connect:
Copy code
await avatar.start(session, room=ctx.room)
await session.start(room=ctx.room, room_output_options=RoomOutputOptions(audio_enabled=False))
• Ensure env vars (used by worker at startup) are set: LIVEAVATAR_API_KEY, LIVEAVATAR_AVATAR_ID, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, LIVEKIT_API_KEY/SECRET (or AGENT_TOKEN if you use token dispatch). If you want, paste your current trial1.py and I’ll mark the exact lines to change. Sources: Job lifecycle | LiveKit docs | Amazon Nova Sonic integration guide | LiveKit docs | LiveAvatar virtual avatar integration guide | LiveKit docs | AWS AI and LiveKit | LiveKit Docs | Voice AI quickstart | LiveKit docs
i
{"level": "INFO", "name": "livekit.agents", "message": "job runner initialized", "tid": 29288, "elapsed_time": 0.0, "timestamp": "2025-12-11T092752.462894+00:00"} {"level": "ERROR", "name": "livekit.agents", "message": "unhandled exception while running the job task", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\plugins\\aws\\__init__.py\", line 32, in __getattr__\n from .experimental import realtime\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\plugins\\aws\\experimental\\realtime\\__init__.py\", line 1, in <module>\n from .realtime_model import RealtimeModel, RealtimeSession\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\plugins\\aws\\experimental\\realtime\\realtime_model.py\", line 18, in <module>\n from aws_sdk_bedrock_runtime.client import (\nModuleNotFoundError: No module named 'aws_sdk_bedrock_runtime'\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\opentelemetry\\util\\_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\agents\\ipc\\job_proc_lazy_main.py\", line 286, in _traceable_entrypoint\n await self._job_entrypoint_fnc(job_ctx)\n File \"C:\\Users\\MalayarajMaity\\IG_repos\\genai-trial\\4hira-avatar\\voice-agent\\trial1.py\", line 19, in entrypoint\n llm=aws.realtime.RealtimeModel(\n File \"C:\\Users\\MalayarajMaity\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\livekit\\plugins\\aws\\__init__.py\", line 34, in __getattr__\n raise ImportError(\nImportError: The 'realtime' module requires optional dependencies. Please install them with: pip install 'livekit-plugins-aws[realtime]'", "timestamp": "2025-12-11T092752.608591+00:00"} i can see the agent as participant but same not able to hear anything
t
You're seeing two things: the AWS realtime extra is missing (causing the ImportError), and the agent participant appears but you hear no audio because the realtime model/avatar pipeline isn't running. Fix both with these steps. 1) Install the AWS realtime dependencies
Copy code
uv add "livekit-plugins-aws[realtime]"
# or with pip:
pip install "livekit-plugins-aws[realtime]"
This provides the
aws_sdk_bedrock_runtime
dependency required by
aws.realtime.RealtimeModel
. 2) Ensure LiveAvatar plugin is installed (if you want avatar video+audio)
Copy code
uv add "livekit-agents[liveavatar]~=1.3.6"
# or
pip install "livekit-plugins-liveavatar>=1.3.6"
3) Restart your worker process after installs. 4) Verify your code uses the realtime model and avatar correctly • Create the LLM with
aws.realtime.RealtimeModel(...)
. • Start avatar before agent and disable agent audio publishing:
Copy code
await avatar.start(session, room=ctx.room)
await session.start(room=ctx.room, room_output_options=RoomOutputOptions(audio_enabled=False))
5) Confirm env vars are present to the worker process (agent.env or shell): • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION • LIVEAVATAR_API_KEY, LIVEAVATAR_AVATAR_ID • LIVEKIT_API_KEY & LIVEKIT_API_SECRET (worker) or AGENT_TOKEN (if used) 6) Verify audio is published by avatar (frontend checks) • In your frontend, find the avatar participant and confirm it has audio/video tracks. • Use
useVoiceAssistant()
or inspect participant tracks; if avatar publishes AV, you should see a separate participant publishing audio/video (not the agent participant). If after installing the extras you still see no audio: • Share the worker logs after restart (errors or warnings from aws.realtime or liveavatar). • Paste the exact avatar/agent start lines you run (I can spot config issues). Which log output would you like to paste first — the worker stdout after reinstall, or the browser console showing participant/track info?
i
from livekit.plugins import aws
>> aws.realtime
Traceback (most recent call last): File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\__init__.py", line 32, in getattr from .experimental import realtime File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\experimental\realtime\__init__.py", line 1, in <module> from .realtime_model import RealtimeModel, RealtimeSession File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\experimental\realtime\realtime_model.py", line 18, in <module> from aws_sdk_bedrock_runtime.client import ( ModuleNotFoundError: No module named 'aws_sdk_bedrock_runtime' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\__init__.py", line 34, in getattr raise ImportError( ImportError: The 'realtime' module requires optional dependencies. Please install them with: pip install 'livekit-plugins-aws[realtime]'
>>
t
Thanks — that traceback confirms the optional Bedrock runtime package is missing in the Python environment you’re running. Please run these steps in the same interpreter you use to run trial1.py, then paste the outputs here: 1) Install the AWS realtime extras: • pip: pip install "livekit-plugins-aws[realtime]" • or uv: uv add "livekit-plugins-aws[realtime]" 2) Check installed packages and interpreter: • Windows: where python python --version python -m pip show livekit-plugins-aws python -m pip show livekit-plugins-liveavatar python -m pip show aws-sdk-bedrock-runtime || python -m pip show aws_sdk_bedrock_runtime || true python -m pip list • mac/Linux: which python python --version python -m pip show livekit-plugins-aws python -m pip show livekit-plugins-liveavatar python -m pip show aws-sdk-bedrock-runtime || python -m pip show aws_sdk_bedrock_runtime || true python -m pip list 3) Quick import test in the same interpreter: • Run python then: from livekit.plugins import aws print(hasattr(aws, "realtime")) If it errors, copy the full traceback. 4) Restart your worker and paste the first ~40 log lines after restart (so I can confirm the plugin loads). If you’re using a virtual environment, confirm you activated it before installing and running the script. If you prefer, tell me which environment manager you use (venv/conda/poetry/uv) and I’ll give exact commands.
i
python python --version python -m pip show livekit-plugins-aws python -m pip show livekit-plugins-liveavatar python -m pip show aws-sdk-bedrock-runtime || python -m pip show awssdkbedrock_runtime || true python -m pip list C\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\python.exe can't open file 'C:\\Users\\MalayarajMaity\\IG_repos\\genai-trial\\4hira-avatar\\voice-agent\\python': [Errno 2] No such file or directory WARNING: Package(s) not found: awssdkbedrock_runtime
t
You're running several commands on one line — Windows tried to open a file named "python" and failed. Run each check/install command separately in the same Python interpreter you use to run trial1.py. Do these steps and paste the outputs: 1) Install the AWS realtime extras (run once):
Copy code
pip install "livekit-plugins-aws[realtime]"
2) Verify packages & interpreter (run each as a separate command):
Copy code
where python
python --version
python -m pip show livekit-plugins-aws
python -m pip show livekit-plugins-liveavatar
python -m pip show aws-sdk-bedrock-runtime || python -m pip show aws_sdk_bedrock_runtime || true
python -m pip list
3) Quick import test (open Python REPL by running
python
, then enter these lines):
Copy code
from livekit.plugins import aws
print(hasattr(aws, "realtime"))
If that errors, copy the full traceback. If you used a virtualenv/conda/uv environment when installing packages, activate the same environment before running the commands. Tell me which environment manager you use if you want exact activation commands.
i
zureAD+MalayarajMaity@INL-1N12510J9J MINGW64 ~/IG_repos/genai-trial/4hira-avatar/voice-agent (main) $ python --version Python 3.10.0 AzureAD+MalayarajMaity@INL-1N12510J9J MINGW64 ~/IG_repos/genai-trial/4hira-avatar/voice-agent (main) $ python -m pip show livekit-plugins-aws Name: livekit-plugins-aws Version: 1.3.6 Summary: LiveKit Agents Plugin for services from AWS Home-page: Author: Author-email: LiveKit <hello@livekit.io> License: Location: c:\users\malayarajmaity\appdata\local\programs\python\python310\lib\site-packages Requires: livekit-agents, aioboto3 Required-by: AzureAD+MalayarajMaity@INL-1N12510J9J MINGW64 ~/IG_repos/genai-trial/4hira-avatar/voice-agent (main) $ python -m pip show livekit-plugins-liveavatar Name: livekit-plugins-liveavatar Version: 1.3.6 Summary: Agent Framework plugin for LiveAvatar Home-page: Author: Author-email: LiveKit <support@livekit.io> License: Location: c:\users\malayarajmaity\appdata\local\programs\python\python310\lib\site-packages Requires: livekit-agents Required-by: AzureAD+MalayarajMaity@INL-1N12510J9J MINGW64 ~/IG_repos/genai-trial/4hira-avatar/voice-agent (main) $ python -m pip show aws-sdk-bedrock-runtime WARNING: Package(s) not found: aws-sdk-bedrock-runtime AzureAD+MalayarajMaity@INL-1N12510J9J MINGW64 ~/IG_repos/genai-trial/4hira-avatar/voice-agent (main) $ python -m pip list Package Version ---------------------------------------- --------------- aioboto3 15.5.0 aiobotocore 2.25.1 aiofiles 25.1.0 aiohappyeyeballs 2.6.1 aiohttp 3.13.2 aioitertools 0.13.0 aiosignal 1.4.0 annotated-types 0.7.0 anyio 4.12.0 async-timeout 5.0.1 attrs 25.4.0 av 16.0.1 boto3 1.40.61 botocore 1.40.61 certifi 2025.11.12 cffi 2.0.0 charset-normalizer 3.4.4 click 8.3.1 colorama 0.4.6 distro 1.9.0 docstring_parser 0.17.0 eval_type_backport 0.3.1 exceptiongroup 1.3.1 frozenlist 1.8.0 googleapis-common-protos 1.72.0 grpcio 1.76.0 h11 0.16.0 httpcore 1.0.9 httpx 0.28.1 idna 3.11 importlib_metadata 8.7.0 jiter 0.12.0 jmespath 1.0.1 livekit 1.0.20 livekit-agents 1.3.6 livekit-api 1.1.0 livekit-blingfire 1.0.0 livekit-plugins-aws 1.3.6 livekit-plugins-liveavatar 1.3.6 livekit-protocol 1.1.1 markdown-it-py 4.0.0 mdurl 0.1.2 multidict 6.7.0 nest-asyncio 1.6.0 numpy 2.2.6 openai 2.9.0 opentelemetry-api 1.39.0 opentelemetry-exporter-otlp 1.39.0 opentelemetry-exporter-otlp-proto-common 1.39.0 opentelemetry-exporter-otlp-proto-grpc 1.39.0 opentelemetry-exporter-otlp-proto-http 1.39.0 opentelemetry-proto 1.39.0 opentelemetry-sdk 1.39.0 opentelemetry-semantic-conventions 0.60b0 pip 21.2.3 prometheus_client 0.23.1 propcache 0.4.1 protobuf 6.33.2 psutil 7.1.3 pycparser 2.23 pydantic 2.12.5 pydantic_core 2.41.5 Pygments 2.19.2 PyJWT 2.10.1 python-dateutil 2.9.0.post0 python-dotenv 1.2.1 requests 2.32.5 rich 14.2.0 s3transfer 0.14.0 setuptools 57.4.0 shellingham 1.5.4 six 1.17.0 sniffio 1.3.1 sounddevice 0.5.3 tqdm 4.67.1 typer 0.20.0 types-protobuf 6.32.1.20251210 typing_extensions 4.15.0 typing-inspection 0.4.2 urllib3 2.6.1 watchfiles 1.1.1 wrapt 1.17.3 yarl 1.22.0 zipp 3.23.0 WARNING: You are using pip version 21.2.3; however, version 25.3 is available. You should consider upgrading via the 'C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
t
Thanks — your environment shows the LiveKit AWS and LiveAvatar plugins are installed, but the Bedrock runtime package is missing, which is why
aws.realtime
fails and the avatar has no audio. Please run these steps in the same Python interpreter you’re using (you confirmed Python 3.10): 1) Install the Bedrock runtime extras for the AWS plugin:
Copy code
python -m pip install "livekit-plugins-aws[realtime]"
2) After install, verify the package is present:
Copy code
python -m pip show aws-sdk-bedrock-runtime || python -m pip show aws_sdk_bedrock_runtime
3) Quick import test (same interpreter):
Copy code
python - <<'PY'
from livekit.plugins import aws
print(hasattr(aws, "realtime"))
PY
Expected output: True 4) Restart your worker and watch logs. If successful you should see no ImportError and the agent/avatar pipeline should produce audio. If you still get errors, paste the full traceback from the import test and the first ~40 lines of the worker log after restart. I’ll point out the exact next step.
i
python - <<'PY' from livekit.plugins import aws print(hasattr(aws, "realtime")) PY Traceback (most recent call last): File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\__init__.py", line 32, in getattr from .experimental import realtime File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\experimental\realtime\__init__.py", line 1, in <module> from .realtime_model import RealtimeModel, RealtimeSession File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\experimental\realtime\realtime_model.py", line 18, in <module> from aws_sdk_bedrock_runtime.client import ( ModuleNotFoundError: No module named 'aws_sdk_bedrock_runtime' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 2, in <module> File "C:\Users\MalayarajMaity\AppData\Local\Programs\Python\Python310\lib\site-packages\livekit\plugins\aws\__init__.py", line 34, in getattr raise ImportError( ImportError: The 'realtime' module requires optional dependencies. Please install them with: pip install 'livekit-plugins-aws[realtime]'
t
Thanks — the traceback still shows the Bedrock runtime package is missing. Let’s get that installed and verified in the same Python interpreter you’re using. Run these commands one at a time in your shell (you already confirmed python is at C:\Users\...\Python310\python.exe): 1) Install the AWS realtime extras (this will install aws SDK Bedrock runtime)
Copy code
python -m pip install --upgrade pip
python -m pip install "livekit-plugins-aws[realtime]"
2) Verify the Bedrock package is present
Copy code
python -m pip show aws-sdk-bedrock-runtime || python -m pip show aws_sdk_bedrock_runtime
3) Quick import test
Copy code
python - <<'PY'
from livekit.plugins import aws
print(hasattr(aws, "realtime"))
PY
Expected output: True 4) Restart your worker (stop and run:)
Copy code
python trial1.py start
If the import test still errors, paste the full traceback from step 3 and the output of:
Copy code
python -m pip list
so I can spot which package failed to install or if multiple interpreters are in use.
i
i have installed packages using uv
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
i
how do i run trial1.py using uv?
uv run --python 3.12 trial1.py start Traceback (most recent call last): File "C:\Users\MalayarajMaity\IG_repos\genai-trial\4hira-avatar\voice-agent\trial1.py", line 7, in <module> from livekit.plugins import aws, liveavatar ImportError: cannot import name 'liveavatar' from 'livekit.plugins' (unknown location)