fix: update AgentSession.start() for livekit-agents 1.x API

livekit-agents 1.x removed the 'participant' parameter from
AgentSession.start(). Use room_input_options with participant_identity
instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-28 10:31:04 -08:00
parent 19efeec26d
commit f1d50e43f1
1 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,7 @@ import json
import logging
from livekit import agents, rtc
from livekit.agents import AgentSession, Agent, RoomInputOptions, JobContext, JobProcess, cli, WorkerOptions
from livekit.agents import AgentSession, Agent, RoomInputOptions, JobContext, JobProcess, cli, WorkerOptions, room_io
from livekit.plugins import silero
from .config import settings
@ -170,9 +170,11 @@ async def entrypoint(ctx: JobContext) -> None:
)
await session.start(
room=ctx.room,
agent=IT0VoiceAgent(),
participant=participant,
room=ctx.room,
room_input_options=room_io.RoomInputOptions(
participant_identity=participant.identity,
),
)
logger.info("Voice session started for participant %s", participant.identity)