Skip to content
Merged
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
11 changes: 8 additions & 3 deletions livekit-agents/livekit/agents/job.py
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from .telemetry.traces import _BufferingHandler, _setup_cloud_tracer, _shutdown_telemetry
from .types import NotGivenOr
from .utils import http_context, is_given, wait_for_participant
from .utils.deprecation import deprecate_params
from .utils.misc import is_cloud

_JobContextVar = contextvars.ContextVar["JobContext"]("agents_job_context")
Expand Down Expand Up @@ -494,26 +495,30 @@ async def wait_for_participant(

return await wait_for_participant(self._room, identity=identity, kind=kind)

@deprecate_params({"e2ee": "Use `encryption` instead."})
async def connect(
self,
*,
e2ee: rtc.E2EEOptions | None = None,
encryption: rtc.E2EEOptions | None = None,
auto_subscribe: AutoSubscribe = AutoSubscribe.SUBSCRIBE_ALL,
rtc_config: rtc.RtcConfiguration | None = None,
# deprecated
e2ee: rtc.E2EEOptions | None = None,
) -> None:
"""Connect to the room. This method should be called only once.

Args:
e2ee: End-to-end encryption options. If provided, the Agent will utilize end-to-end encryption. Note: clients will also need to handle E2EE.
encryption: End-to-end encryption options. If provided, the Agent will utilize end-to-end encryption. Note: clients will also need to handle E2EE.
auto_subscribe: Whether to automatically subscribe to tracks. Default is AutoSubscribe.SUBSCRIBE_ALL.
rtc_config: Custom RTC configuration to use when connecting to the room.
""" # noqa: E501
async with self._lock:
if self._connected:
return

encryption = encryption or e2ee
room_options = rtc.RoomOptions(
encryption=e2ee,
encryption=encryption,
auto_subscribe=auto_subscribe == AutoSubscribe.SUBSCRIBE_ALL,
rtc_config=rtc_config,
)
Expand Down
Loading