From 670e0bc5543e4908d9d24284ffb4f5357e6508f8 Mon Sep 17 00:00:00 2001 From: Topher Hindman Date: Tue, 10 Feb 2026 09:59:37 -0800 Subject: [PATCH 1/2] Update to livekit-agents 1.4, add Python 3.14 support --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 30104e7..e3aeb6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta" name = "agent-starter-python" version = "1.0.0" description = "Simple voice AI assistant built with LiveKit Agents for Python" -requires-python = ">=3.10, <3.14" +requires-python = ">=3.10, <3.15" dependencies = [ - "livekit-agents[silero,turn-detector]~=1.3", + "livekit-agents[silero,turn-detector]~=1.4", "livekit-plugins-noise-cancellation~=0.2", "python-dotenv", ] From 9d073b44ba06d58c59c480eaddbddc8281fbf434 Mon Sep 17 00:00:00 2001 From: Topher Hindman Date: Wed, 11 Feb 2026 13:05:55 -0800 Subject: [PATCH 2/2] Use explicit dispatch by default Set agent_name="my-agent" on the rtc_session decorator so the agent must be explicitly dispatched to a room rather than auto-joining every new room. Update the taskfile template substitution to match the new decorator-based pattern. --- src/agent.py | 11 +++++++---- taskfile.yaml | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/agent.py b/src/agent.py index aab4ded..eba121f 100644 --- a/src/agent.py +++ b/src/agent.py @@ -57,7 +57,7 @@ def prewarm(proc: JobProcess): server.setup_fnc = prewarm -@server.rtc_session() +@server.rtc_session(agent_name="my-agent") async def my_agent(ctx: JobContext): # Logging setup # Add any other context you want in all log entries here @@ -111,9 +111,12 @@ async def my_agent(ctx: JobContext): room=ctx.room, room_options=room_io.RoomOptions( audio_input=room_io.AudioInputOptions( - noise_cancellation=lambda params: noise_cancellation.BVCTelephony() - if params.participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP - else noise_cancellation.BVC(), + noise_cancellation=lambda params: ( + noise_cancellation.BVCTelephony() + if params.participant.kind + == rtc.ParticipantKind.PARTICIPANT_KIND_SIP + else noise_cancellation.BVC() + ), ), ), ) diff --git a/taskfile.yaml b/taskfile.yaml index 1863598..eb81409 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -30,8 +30,8 @@ tasks: - test -z "$LIVEKIT_AGENT_NAME" cmds: - | - old="WorkerOptions(" - new="WorkerOptions(agent_name=\"{{ .LIVEKIT_AGENT_NAME }}\", " + old='agent_name="my-agent"' + new='agent_name="{{ .LIVEKIT_AGENT_NAME }}"' file="{{ .PYTHON_MAIN }}" tmp="$(mktemp)" while IFS= read -r line; do