From f234180b248cd69b6ec069984d3319b24e5a5260 Mon Sep 17 00:00:00 2001 From: Jon Taylor Date: Mon, 20 Oct 2025 23:12:24 +0100 Subject: [PATCH] classmethod to normalizing requestData casing --- src/pipecat/transports/smallwebrtc/request_handler.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pipecat/transports/smallwebrtc/request_handler.py b/src/pipecat/transports/smallwebrtc/request_handler.py index b2c02a03e..6ccb11f01 100644 --- a/src/pipecat/transports/smallwebrtc/request_handler.py +++ b/src/pipecat/transports/smallwebrtc/request_handler.py @@ -39,6 +39,12 @@ class SmallWebRTCRequest: restart_pc: Optional[bool] = None request_data: Optional[Any] = None + @classmethod + def from_dict(cls, data: dict): + """Accept both snake_case and camelCase for the request_data field.""" + if "requestData" in data and "request_data" not in data: + data["request_data"] = data.pop("requestData") + return cls(**data) @dataclass class IceCandidate: