Undeprecate DailyUpdateRemoteParticipantsFrame
Remove the deprecation warning and __post_init__ override. Also fix the default value for remote_participants to use field(default_factory=dict) instead of None.
This commit is contained in:
1
changelog/3719.changed.md
Normal file
1
changelog/3719.changed.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- `DailyUpdateRemoteParticipantsFrame` is no longer deprecated and is now queued with audio like other transport frames.
|
||||||
@@ -25,7 +25,6 @@ from pydantic import BaseModel
|
|||||||
from pipecat.audio.vad.vad_analyzer import VADAnalyzer, VADParams
|
from pipecat.audio.vad.vad_analyzer import VADAnalyzer, VADParams
|
||||||
from pipecat.frames.frames import (
|
from pipecat.frames.frames import (
|
||||||
CancelFrame,
|
CancelFrame,
|
||||||
ControlFrame,
|
|
||||||
DataFrame,
|
DataFrame,
|
||||||
EndFrame,
|
EndFrame,
|
||||||
Frame,
|
Frame,
|
||||||
@@ -214,34 +213,14 @@ class DailySIPReferFrame(DataFrame):
|
|||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class DailyUpdateRemoteParticipantsFrame(ControlFrame):
|
class DailyUpdateRemoteParticipantsFrame(DataFrame):
|
||||||
"""Frame to update remote participants in Daily calls.
|
"""Frame to update remote participants in Daily calls.
|
||||||
|
|
||||||
.. deprecated:: 0.0.87
|
|
||||||
`DailyUpdateRemoteParticipantsFrame` is deprecated and will be removed in a future version.
|
|
||||||
Create your own custom frame and use a custom processor to handle it or use, for example,
|
|
||||||
`on_after_push_frame` event instead in the output transport.
|
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
remote_participants: See https://reference-python.daily.co/api_reference.html#daily.CallClient.update_remote_participants.
|
remote_participants: See https://reference-python.daily.co/api_reference.html#daily.CallClient.update_remote_participants.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
remote_participants: Mapping[str, Any] = None
|
remote_participants: Mapping[str, Any] = field(default_factory=dict)
|
||||||
|
|
||||||
def __post_init__(self):
|
|
||||||
super().__post_init__()
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
with warnings.catch_warnings():
|
|
||||||
warnings.simplefilter("always")
|
|
||||||
warnings.warn(
|
|
||||||
"DailyUpdateRemoteParticipantsFrame is deprecated and will be removed in a future version."
|
|
||||||
"Instead, create your own custom frame and handle it in the "
|
|
||||||
'`@transport.output().event_handler("on_after_push_frame")` event handler or a '
|
|
||||||
"custom processor.",
|
|
||||||
DeprecationWarning,
|
|
||||||
stacklevel=2,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class WebRTCVADAnalyzer(VADAnalyzer):
|
class WebRTCVADAnalyzer(VADAnalyzer):
|
||||||
@@ -1977,18 +1956,6 @@ class DailyOutputTransport(BaseOutputTransport):
|
|||||||
# Leave the room.
|
# Leave the room.
|
||||||
await self._client.leave()
|
await self._client.leave()
|
||||||
|
|
||||||
async def process_frame(self, frame: Frame, direction: FrameDirection):
|
|
||||||
"""Process outgoing frames, including transport messages.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
frame: The frame to process.
|
|
||||||
direction: The direction of frame flow in the pipeline.
|
|
||||||
"""
|
|
||||||
await super().process_frame(frame, direction)
|
|
||||||
|
|
||||||
if isinstance(frame, DailyUpdateRemoteParticipantsFrame):
|
|
||||||
await self._client.update_remote_participants(frame.remote_participants)
|
|
||||||
|
|
||||||
async def send_message(
|
async def send_message(
|
||||||
self, frame: OutputTransportMessageFrame | OutputTransportMessageUrgentFrame
|
self, frame: OutputTransportMessageFrame | OutputTransportMessageUrgentFrame
|
||||||
):
|
):
|
||||||
@@ -1999,7 +1966,7 @@ class DailyOutputTransport(BaseOutputTransport):
|
|||||||
"""
|
"""
|
||||||
error = await self._client.send_message(frame)
|
error = await self._client.send_message(frame)
|
||||||
if error:
|
if error:
|
||||||
await self.push_error(f"{self}: Unable to send message: {error}")
|
await self.push_error(f"Unable to send message: {error}")
|
||||||
|
|
||||||
async def register_video_destination(self, destination: str):
|
async def register_video_destination(self, destination: str):
|
||||||
"""Register a video output destination.
|
"""Register a video output destination.
|
||||||
@@ -2051,11 +2018,15 @@ class DailyOutputTransport(BaseOutputTransport):
|
|||||||
if isinstance(frame, DailySIPTransferFrame):
|
if isinstance(frame, DailySIPTransferFrame):
|
||||||
error = await self._client.sip_call_transfer(frame.settings)
|
error = await self._client.sip_call_transfer(frame.settings)
|
||||||
if error:
|
if error:
|
||||||
await self.push_error(f"{self}: Unable to transfer SIP call: {error}")
|
await self.push_error(f"Unable to transfer SIP call: {error}")
|
||||||
elif isinstance(frame, DailySIPReferFrame):
|
elif isinstance(frame, DailySIPReferFrame):
|
||||||
error = await self._client.sip_refer(frame.settings)
|
error = await self._client.sip_refer(frame.settings)
|
||||||
if error:
|
if error:
|
||||||
await self.push_error(f"{self}: Unable to perform SIP REFER: {error}")
|
await self.push_error(f"Unable to perform SIP REFER: {error}")
|
||||||
|
elif isinstance(frame, DailyUpdateRemoteParticipantsFrame):
|
||||||
|
error = await self._client.update_remote_participants(frame.remote_participants)
|
||||||
|
if error:
|
||||||
|
await self.push_error(f"Unable to update remote participants: {error}")
|
||||||
|
|
||||||
def _supports_native_dtmf(self) -> bool:
|
def _supports_native_dtmf(self) -> bool:
|
||||||
"""Daily supports native DTMF via telephone events.
|
"""Daily supports native DTMF via telephone events.
|
||||||
|
|||||||
Reference in New Issue
Block a user