Skip to content
Merged
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
7 changes: 2 additions & 5 deletions livekit-agents/livekit/agents/beta/workflows/warm_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from livekit import api, rtc

from ... import llm, stt, tts, utils, vad
from ...job import get_job_context
from ...job import DEFAULT_PARTICIPANT_KINDS, get_job_context
from ...llm.tool_context import ToolError, ToolFlag, function_tool
from ...log import logger
from ...types import NOT_GIVEN, NotGivenOr
Expand Down Expand Up @@ -242,10 +242,7 @@ def _on_human_agent_room_close(self, reason: rtc.DisconnectReason.ValueType) ->
self._set_result(ToolError(f"room closed: {rtc.DisconnectReason.Name(reason)}"))

def _on_caller_participant_disconnected(self, participant: rtc.RemoteParticipant) -> None:
if participant.kind not in (
rtc.ParticipantKind.PARTICIPANT_KIND_SIP,
rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD,
):
if participant.kind not in DEFAULT_PARTICIPANT_KINDS:
return

logger.info(f"participant disconnected from caller room: {participant.identity}, closing")
Expand Down
1 change: 1 addition & 0 deletions livekit-agents/livekit/agents/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class RunningJobInfo:


DEFAULT_PARTICIPANT_KINDS: list[rtc.ParticipantKind.ValueType] = [
rtc.ParticipantKind.PARTICIPANT_KIND_CONNECTOR,
rtc.ParticipantKind.PARTICIPANT_KIND_SIP,
rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD,
]
Expand Down
2 changes: 1 addition & 1 deletion livekit-agents/livekit/agents/voice/room_io/room_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
from ..agent_session import AgentSession


from ...job import DEFAULT_PARTICIPANT_KINDS
from ._input import _ParticipantAudioInputStream, _ParticipantVideoInputStream
from ._output import _ParticipantAudioOutput, _ParticipantTranscriptionOutput
from .types import (
DEFAULT_CLOSE_ON_DISCONNECT_REASONS,
DEFAULT_PARTICIPANT_KINDS,
RoomInputOptions,
RoomOptions,
RoomOutputOptions,
Expand Down
7 changes: 0 additions & 7 deletions livekit-agents/livekit/agents/voice/room_io/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
if TYPE_CHECKING:
from ..agent_session import AgentSession


DEFAULT_PARTICIPANT_KINDS: list[rtc.ParticipantKind.ValueType] = [
rtc.ParticipantKind.PARTICIPANT_KIND_SIP,
rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD,
rtc.ParticipantKind.PARTICIPANT_KIND_CONNECTOR,
]

DEFAULT_CLOSE_ON_DISCONNECT_REASONS: list[rtc.DisconnectReason.ValueType] = [
rtc.DisconnectReason.CLIENT_INITIATED,
rtc.DisconnectReason.ROOM_DELETED,
Expand Down
Loading