Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
11 changes: 7 additions & 4 deletions src/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
),
),
),
)
Expand Down
4 changes: 2 additions & 2 deletions taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down