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.
This commit is contained in:
Topherhindman
2026-02-17 15:04:41 -08:00
committed by GitHub
parent b66728d81f
commit cb13593fbc
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta"
name = "agent-starter-python" name = "agent-starter-python"
version = "1.0.0" version = "1.0.0"
description = "Simple voice AI assistant built with LiveKit Agents for Python" description = "Simple voice AI assistant built with LiveKit Agents for Python"
requires-python = ">=3.10, <3.14" requires-python = ">=3.10, <3.15"
dependencies = [ dependencies = [
"livekit-agents[silero,turn-detector]~=1.3", "livekit-agents[silero,turn-detector]~=1.4",
"livekit-plugins-noise-cancellation~=0.2", "livekit-plugins-noise-cancellation~=0.2",
"python-dotenv", "python-dotenv",
] ]
+1 -1
View File
@@ -57,7 +57,7 @@ def prewarm(proc: JobProcess):
server.setup_fnc = prewarm server.setup_fnc = prewarm
@server.rtc_session() @server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: JobContext): async def my_agent(ctx: JobContext):
# Logging setup # Logging setup
# Add any other context you want in all log entries here # Add any other context you want in all log entries here
+2 -2
View File
@@ -30,8 +30,8 @@ tasks:
- test -z "$LIVEKIT_AGENT_NAME" - test -z "$LIVEKIT_AGENT_NAME"
cmds: cmds:
- | - |
old="WorkerOptions(" old='agent_name="my-agent"'
new="WorkerOptions(agent_name=\"{{ .LIVEKIT_AGENT_NAME }}\", " new='agent_name="{{ .LIVEKIT_AGENT_NAME }}"'
file="{{ .PYTHON_MAIN }}" file="{{ .PYTHON_MAIN }}"
tmp="$(mktemp)" tmp="$(mktemp)"
while IFS= read -r line; do while IFS= read -r line; do