From cb13593fbc6617b23c5963280f9b21b02c5c6cb4 Mon Sep 17 00:00:00 2001 From: Topherhindman Date: Tue, 17 Feb 2026 15:04:41 -0800 Subject: [PATCH] Update to livekit-agents 1.4, add Python 3.14 support (#47) * Update to livekit-agents 1.4, add Python 3.14 support * 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. --- pyproject.toml | 4 ++-- src/agent.py | 2 +- taskfile.yaml | 4 ++-- 3 files changed, 5 insertions(+), 5 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", ] diff --git a/src/agent.py b/src/agent.py index 4554073..fbc807a 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 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