Livekit rtc audioframe

hi, trying to use livekit for the first time. this is the code.

import logging

from dotenv import load_dotenv

from livekit import agents

from livekit.agents import Agent, AgentServer, AgentSession, JobContext, room_io

from livekit.plugins import noise_cancellation, silero

load_dotenv()

# Define your agent’s behavior by extending the Agent class

class Assistant(Agent):

def \__init_\_(self) -> None:

    super().\__init_\_(

        instructions="You are a helpful voice AI assistant.",  # System prompt for the LLM

    )

server = AgentServer()

# The entrypoint function runs when a participant joins the room

@server.rtc_session()

async def entrypoint(ctx: JobContext):

\# Configure the voice pipeline with STT, LLM, TTS, and VAD providers

session = AgentSession(

    stt="assemblyai/universal-streaming:en",  # Speech-to-text provider

    llm="openai/gpt-4.1-mini",                # Language model for responses

    tts="cartesia/sonic-3",                   # Text-to-speech voice

    vad=silero.VAD.load(),                    # Voice activity detection

)



\# Start the session with noise cancellation enabled

await session.start(

    agent=Assistant(),

    room=ctx.room,

    room_options=room_io.RoomOptions(

        audio_input=room_io.AudioInputOptions(

            noise_cancellation=noise_cancellation.BVC(),  # Background voice cancellation

        ),

    ),

)

if _name_ == “_main_”:

logging.basicConfig(level=logging.INFO)

agents.cli.run_app(server)

then running this in powershell uv run agent.py download-files

but getting this error AudioBuffer = list[rtc.AudioFrame] | rtc.AudioFrame. any thoughts please? thanks

What version of Python are you using?

python --version

Please note that LiveKit requires Python version >= 3.10 : Voice AI quickstart | LiveKit Documentation

yep i am using python 3.13

I hadn’t tried it on Windows in quite some time, so I set up a new project just to be sure.

I notice the instructions at Voice AI quickstart | LiveKit Documentation have changed slightly since I remember, whereas previously you would run uv run agent.py download-files, I see step 4 is uv run --module livekit.agents download-files. So perhaps the instructions you are following are out of date? I wouldn’t say that’s definitely the reason however.

Are you running through the Voice AI quickstart | LiveKit Documentation ? might be worth giving that a go first. The only other difference is I installed Python 3.14.5 but that discrepency from 3.13 should not matter.

hi Darryn, thanks for the advice. I have tried that but still getting this problem? any thoughts? thanks

this is the guide i am following also Voice Agent Foundations | Building Production-Ready Voice Agents with LiveKit

I’m sorry, but I tried again and I can’t reproduce this. I tried with a path with a space in, and I tried to downgrade my version of Python in case that was the issue.

I hate saying this, but it’s helped me with similar tool set up issues in the past, if you install our MCP and ask Claude / CoPilot / Cursor, I’m sure it will figure out the issue: Coding agent support and tools | LiveKit Documentation

In addition to Darryn’s suggestions, can you also share

uv run python -c "from livekit import rtc; print(rtc.__file__); print(hasattr(rtc,'AudioFrame'))"
uv pip list | findstr livekit

rtc.__file__ will tell us immediately whether it’s resolving to the real site-packages\livekit\rtc\__init__.py (and what version) or to something else — a stray livekit.py/livekit/ folder in the project, or an empty namespace dir from a half-installed livekit-rtc.

hi, thanks for your help on this matter. i have ran these commands in powershell. if you could get back to me on what this means i’d be super grateful.

also tried it again this morning:

I will take a look. But in the future, it will be much easier for me to help you if you attach text files of the output or include the output as text in your response. Searching text in images is a bit of a struggle.

That output means the environment you just tested is healthy: rtc.__file__ points at the real package inside the venv, AudioFrame is there (True), and livekit 1.1.8 + livekit-agents 1.5.17 is exactly the matched pair agents expects.

But note the paths: your diagnostic ran in Desktop\livekit-8\livekit-voice-agent, while the original error came from Desktop\livekit04\livekit-voice-agent — a different project with a broken livekit install.

So just work from the livekit-8 project:

uv run --module livekit.agents download-files
uv run agent.py console

That should run fine. I’d delete livekit04 to avoid mixing them up.

That SSL: CERTIFICATE_VERIFY_FAILED looks suspicious to me too. I haven’t come across it myself but this StackOverflow post looks relevant: https://stackoverflow.com/questions/77442172/ssl-certificate-verify-failed-certificate-verify-failed-unable-to-get-local-is.