From e23a3404457d54a9709ff943cc4aad67ce94a57f Mon Sep 17 00:00:00 2001 From: tdjx Date: Thu, 11 Sep 2025 14:25:23 +0500 Subject: [PATCH] add close_on_disconnect --- ai_interviewer_agent.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ai_interviewer_agent.py b/ai_interviewer_agent.py index f4470e8..3d3b0a5 100644 --- a/ai_interviewer_agent.py +++ b/ai_interviewer_agent.py @@ -16,7 +16,7 @@ if os.name == "nt": # Windows # Устанавливаем переменную окружения для Python os.environ.setdefault("PYTHONIOENCODING", "utf-8") -from livekit.agents import Agent, AgentSession, JobContext, WorkerOptions, cli +from livekit.agents import Agent, AgentSession, JobContext, WorkerOptions, cli, RoomInputOptions from livekit.api import DeleteRoomRequest, LiveKitAPI from livekit.plugins import openai, silero @@ -765,7 +765,10 @@ async def entrypoint(ctx: JobContext): # Проверяем ключевые фразы для завершения интервью asyncio.create_task(check_interview_completion_by_keywords(text)) - await session.start(agent=agent, room=ctx.room) + input_options = RoomInputOptions( + close_on_disconnect=False, + ) + await session.start(agent=agent, room=ctx.room, room_input_options=input_options) logger.info("[INIT] AI Interviewer started")